generated from dymensionxyz/rollapp
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into hoang/stalebot
- Loading branch information
Showing
11 changed files
with
212 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
# pre-push hook script | ||
|
||
# Ensure golangci-lint is installed | ||
if ! command -v golangci-lint >/dev/null 2>&1; then | ||
echo "golangci-lint is not installed. Please install it with 'go install github.com/golangci/golangci-lint/cmd/[email protected]'" | ||
exit 1 | ||
fi | ||
|
||
# Ensure markdownlint is installed | ||
if ! command -v markdownlint >/dev/null 2>&1; then | ||
echo "markdownlint-cli is not installed. Please install it with 'npm install -g markdownlint-cli'" | ||
exit 1 | ||
fi | ||
|
||
# Run golangci-lint | ||
golangci-lint run | ||
|
||
# Capture the exit status of golangci-lint | ||
RESULT=$? | ||
if [ $RESULT -ne 0 ]; then | ||
echo "golangci-lint checks failed. Aborting push." | ||
exit 1 | ||
fi | ||
|
||
# Run markdownlint | ||
markdownlint . --config .markdownlint.yaml | ||
|
||
# Capture the exit status of markdownlint | ||
RESULT=$? | ||
if [ $RESULT -ne 0 ]; then | ||
echo "markdownlint checks failed. Aborting push." | ||
exit 1 | ||
fi | ||
|
||
# If all tests pass, allow the push to proceed | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,77 @@ | ||
# Creating Pr with following name convention. Common types include feat (a new feature), fix (a bug fix), docs (documentation changes), | ||
# style (formatting, missing semi colons, etc.), refactor (code refactoring), test (adding missing tests), | ||
# chore (changes to the build process or auxiliary tools and libraries such as documentation generation) | ||
# e.g: feat(ci): Add auto generate changelog workflow | ||
name: Changelog Update | ||
name: Auto Changelog Update | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
types: [closed] | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
update_changelog: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true | ||
steps: | ||
- name: Checkout code | ||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.merge_commit_sha }} | ||
fetch-depth: 1 | ||
|
||
- name: Set up Node.js | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Install conventional-changelog-cli | ||
run: npm install -g conventional-changelog-cli | ||
node-version: '18' | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name 'github-actions' | ||
git config user.email 'github-actions@github.com' | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
- name: Simulate commit for PR title | ||
- name: Check if "auto-changelog-update-do-not-create-manually" branch exists | ||
id: check_branch | ||
run: | | ||
echo "${{ github.event.pull_request.title }}" > temp_message.txt | ||
git commit --allow-empty -F temp_message.txt | ||
if [ -n "$(git ls-remote --heads origin auto-changelog-update-do-not-create-manually)" ]; then | ||
git fetch origin auto-changelog-update-do-not-create-manually | ||
echo "branch_exists=true" >> $GITHUB_ENV | ||
else | ||
echo "branch_exists=false" >> $GITHUB_ENV | ||
fi | ||
- name: Generate changelog | ||
- name: Generate Changelog Update and update if branch exists | ||
run: | | ||
conventional-changelog -p angular -i CHANGELOG.md -s -r 0 | ||
npm install -g conventional-changelog-cli | ||
if [ "$branch_exists" == "true" ]; then | ||
git checkout auto-changelog-update-do-not-create-manually | ||
git merge main --strategy-option theirs --allow-unrelated-histories --no-edit | ||
conventional-changelog -p angular -i CHANGELOG.md -s | ||
git add CHANGELOG.md | ||
git commit -m "Update CHANGELOG.md [skip ci]" | ||
git push origin auto-changelog-update-do-not-create-manually | ||
exit 0 | ||
else | ||
git checkout main | ||
git checkout -b auto-changelog-update-do-not-create-manually | ||
git push origin auto-changelog-update-do-not-create-manually | ||
conventional-changelog -p angular -i CHANGELOG.md -s | ||
fi | ||
- name: Show git status and changelog contents | ||
run: | | ||
git status | ||
echo "Changelog contents:" | ||
cat CHANGELOG.md | ||
- name: Create Pull Request | ||
if: env.branch_exists == 'false' | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "Update CHANGELOG.md [skip ci]" | ||
title: "Chore(changelog): Automated Changelog Update [skip ci]" | ||
body: "Update the CHANGELOG.md with recent pushes to branch main." | ||
base: "main" | ||
branch: "auto-changelog-update-do-not-create-manually" | ||
delete-branch: true | ||
|
||
- name: Revert temporary commit | ||
run: git reset HEAD~ | ||
- name: Check outputs | ||
if: env.branch_exists == 'false' | ||
run: | | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | ||
- name: Commit and push changelog update | ||
- name: Log if PR updated | ||
if: steps.cpr.outputs.pull-request-operation == 'updated' | ||
run: | | ||
git add CHANGELOG.md | ||
git diff --staged --quiet || git commit -m "Update CHANGELOG.md based on PR #${{ github.event.pull_request.number }} title" | ||
git push origin HEAD:refs/heads/main | ||
echo "Changelog PR updated due to new commit to main." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: E2E Tests Upgrade | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
# trigger workflow if PR is opened directly as R4R. | ||
- opened | ||
# trigger workflow if changes are pushed to the branch. | ||
- synchronize | ||
# trigger workflow if PR is marked ready for review. | ||
- ready_for_review | ||
paths: | ||
- 'app/upgrades/**' | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
UPGRADE_NAME: ${{ steps.set-output.outputs.upgrade }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set environment variable | ||
id: set-output | ||
run: | | ||
upgradeName=$(ls -d -- ./app/upgrades/v* | sort -Vr | head -n 1 | xargs basename) | ||
echo "upgrade=$upgradeName" >> $GITHUB_OUTPUT | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and export | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: Dockerfile | ||
context: . | ||
outputs: type=docker,dest=/tmp/e2e.tar | ||
platforms: linux/amd64 | ||
tags: | | ||
ghcr.io/dymensionxyz/dymension:e2e | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: e2e | ||
path: /tmp/e2e.tar | ||
|
||
e2e-tests-upgrade: | ||
needs: build-image | ||
uses: dymensionxyz/e2e-tests/.github/workflows/e2e-test-rollapp-wasm-upgrade-workflow-call.yml@main | ||
with: | ||
dymension_ci: "e2e" | ||
upgrade_name: "${{ needs.build-image.outputs.UPGRADE_NAME }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
# Copy pre-push hook to .git/hooks/ | ||
cp ./.githooks/pre-push ./.git/hooks/pre-push | ||
|
||
# Make the pre-push hook executable | ||
chmod +x .git/hooks/pre-push | ||
|
||
echo "Git push hooks installed successfully." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters