diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 20f1250215..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,173 +0,0 @@ -name: Build -on: - merge_group: - pull_request: - push: - branches: - - main - - release/** - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, macos-14] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: | - **/*.go - *.mod - *.sum - - uses: cachix/cachix-action@v12 - if: steps.changed-files.outputs.any_changed == 'true' - with: - name: cronos - # github don't pass secrets for pull request from fork repos, - # in that case the push is disabled naturally. - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - name: Run build - run: ./scripts/release.sh - if: steps.changed-files.outputs.any_changed == 'true' - - uses: actions/upload-artifact@v3 - with: - name: "cronosd-tarball-${{ matrix.os }}" - path: "*.tar.gz" - if-no-files-found: ignore - - unittest: - runs-on: ubuntu-latest - timeout-minutes: 40 - steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: | - **/*.go - *.mod - *.sum - - uses: cachix/cachix-action@v12 - if: steps.changed-files.outputs.any_changed == 'true' - with: - name: cronos - # github don't pass secrets for pull request from fork repos, - # in that case the push is disabled naturally. - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - name: test & coverage report creation - run: | - nix develop -c make test - nix develop .#rocksdb -c make test-versiondb - if: steps.changed-files.outputs.any_changed == 'true' - - name: filter out proto files - run: | - excludelist+=" $(find ./ -type f -name '*.pb.go')" - for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/crypto-org-chain\/cronos/g') - echo "Excluding ${filename} from coverage report..." - sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt - done - if: steps.changed-files.outputs.any_changed == 'true' - - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.txt,./memiavl/coverage.txt,./store/coverage.txt,./versiondb/coverage.txt - fail_ci_if_error: true - if: steps.changed-files.outputs.any_changed == 'true' - - gomod2nix: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: | - go.mod - go.sum - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - if: steps.changed-files.outputs.any_changed == 'true' - - name: gomod2nix - run: nix develop -c gomod2nix - if: steps.changed-files.outputs.any_changed == 'true' - - name: check working directory is clean - id: changes - run: | - set +e - (git diff --no-ext-diff --exit-code) - echo "name=changed::$?" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v3 - if: steps.changes.outputs.changed == 1 - with: - name: gomod2nix.toml - path: ./gomod2nix.toml - - if: steps.changes.outputs.changed == 1 - run: echo "Working directory is dirty" && exit 1 - - contracts: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: | - contracts - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - if: steps.changed-files.outputs.any_changed == 'true' - - uses: cachix/cachix-action@v12 - if: steps.changed-files.outputs.any_changed == 'true' - with: - name: cronos - extraPullNames: dapp - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - name: test contracts - if: steps.changed-files.outputs.any_changed == 'true' - run: make test-cronos-contracts - - name: build contracts - if: steps.changed-files.outputs.any_changed == 'true' - run: make gen-cronos-contracts - - name: check working directory is clean - id: changes - run: | - set +e - (git diff --no-ext-diff --exit-code) - echo "name=changed::$?" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v3 - if: steps.changes.outputs.changed == 1 - with: - name: contracts_out - path: ./contracts/out - if-no-files-found: ignore - - if: steps.changes.outputs.changed == 1 - run: echo "Working directory is dirty" && exit 1 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 2d8fba0125..0000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,77 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: - - main - - release/** - paths: - - "**.go" - pull_request: - branches: - - main - - release/** - paths: - - "**.go" - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: '^1.22.0' - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: "go" - queries: +security-and-quality,github/codeql/go/ql/src/experimental/InconsistentCode/DeferInLoop.ql@main,github/codeql/go/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql@main,github/codeql/go/ql/src/experimental/CWE-369/DivideByZero.ql@main - packs: +crypto-com/cosmos-sdk-codeql - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml deleted file mode 100644 index af2186af43..0000000000 --- a/.github/workflows/container.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Push Testground Image - -on: - push: - branches: - - main - tags: - - "v*.*.*" - -env: - IMAGE_NAME: cronos-testground - -jobs: - - push: - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-24.05 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - uses: cachix/cachix-action@v12 - with: - name: cronos - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - name: build and push image - run: | - # login to ghcr.io - echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - [ "$VERSION" == "main" ] && VERSION=latest - echo "VERSION: $VERSION" - - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - echo "IMAGE_ID: $IMAGE_ID" - - BUILD_TAG="$(nix eval --raw .#testground-image.imageTag)" - echo "BUILD_TAG: $BUILD_TAG" - - docker load -i "$(nix build --no-link --print-out-paths .#testground-image)" - docker run --rm -e TEST_CASE=info $IMAGE_NAME:$BUILD_TAG - docker tag $IMAGE_NAME:$BUILD_TAG $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml deleted file mode 100644 index f2ce269515..0000000000 --- a/.github/workflows/gosec.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Run Gosec -on: - pull_request: - push: - branches: - - main - - release/** - -jobs: - Gosec: - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - env: - GO111MODULE: on - steps: - - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v3 - with: - SUFFIX_FILTER: | - .go - .mod - .sum - - name: Run Gosec Security Scanner - uses: informalsystems/gosec@master - with: - # we let the report trigger content trigger a failure using the GitHub Security features. - args: '-no-fail -fmt sarif -out results.sarif ./...' - if: "env.GIT_DIFF_FILTERED != ''" - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v2 - with: - # Path to SARIF file relative to the root of the repository - sarif_file: results.sarif - if: "env.GIT_DIFF_FILTERED != ''" diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml deleted file mode 100644 index 14d1641c96..0000000000 --- a/.github/workflows/linkchecker.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Check Markdown links -on: - schedule: - - cron: "* */24 * * *" - pull_request: - push: - branches: - - main - - release/** -jobs: - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: | - docs/**/*.md - - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 - if: steps.changed-files.outputs.any_changed == 'true' - with: - folder-path: "docs" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5601f8efdd..9d30403bc2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: '^1.22.0' + go-version: '1.22.7' - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v23 with: diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml deleted file mode 100644 index 52e96b1b9e..0000000000 --- a/.github/workflows/proto.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Protobuf -# Protobuf runs buf (https://buf.build/) lint and check-breakage -# This workflow is only run when a .proto file has been changed -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - lint: - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6 - with: - PATTERNS: | - **/**.proto - - name: lint - run: make proto-lint - if: env.GIT_DIFF - breakage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6 - with: - PATTERNS: | - **/**.proto - - name: check-breakage - run: make proto-check-breaking - if: env.GIT_DIFF - protogen: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6 - with: - PATTERNS: | - **/**.proto - - name: proto-gen-ci - if: env.GIT_DIFF - run: | - make proto-gen-ci # proto-swagger-gen FIXME swagger-gen result is not reproducible in CI - git checkout -- go.mod go.sum # FIXME doc gen not reproducible in CI - - name: check working directory is clean - uses: numtide/clean-git-action@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 017b829b74..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: release - -on: - push: - tags: - - "v*.*.*" - -permissions: - contents: write - -jobs: - release: - runs-on: ubuntu-latest - environment: release - steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - uses: cachix/cachix-action@v12 - with: - name: cronos - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - - name: build binaries - run: | - # install sha256sum - nix-env -i coreutils -f '' - - # build binaries - ./scripts/release.sh - - # update checksum and upload - sha256sum *.tar.gz > "checksums.txt" - echo 'FILES<> $GITHUB_ENV - ls -1 *.tar.gz >> $GITHUB_ENV - echo "checksums.txt" >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - cat $GITHUB_ENV - - name: upload binaries - uses: softprops/action-gh-release@v1 - with: - draft: true - files: "${{ env.FILES }}" - - release-macos: - # runs sequentially to avoid creating duplicated release - needs: ["release"] - strategy: - matrix: - runner: [macos-13, macos-14] - runs-on: ${{ matrix.runner }} - environment: release - steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - uses: apple-actions/import-codesign-certs@v1 - with: - p12-file-base64: ${{ secrets.MAC_CODE_SIGN_CERT }} - p12-password: ${{ secrets.MAC_CODE_SIGN_CERT_PASS }} - - uses: cachix/cachix-action@v12 - with: - name: cronos - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - name: build binaries - env: - MAC_CODE_API_KEY: ${{ secrets.MAC_CODE_API_KEY }} - MAC_CODE_API_KEY_ID: ${{ secrets.MAC_CODE_API_KEY_ID }} - MAC_CODE_API_ISSUER_ID: ${{ secrets.MAC_CODE_API_ISSUER_ID }} - MAC_CODE_API_DEVELOPER_ID: ${{ secrets.MAC_CODE_API_DEVELOPER_ID }} - run: | - # install sha256sum - nix-env -i coreutils -f '' - - # build binaries - ./scripts/release.sh - - # codesign - for tarball in *.tar.gz; - do - ./scripts/codesign_macos.sh $tarball - mv signed.tar.gz $tarball - done - - # update checksum and upload - CHKFILE="checksums-darwin-$(uname -p).txt" - sha256sum *.tar.gz > "$CHKFILE" - echo 'FILES<> $GITHUB_ENV - ls -1 *.tar.gz >> $GITHUB_ENV - echo "$CHKFILE" >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - cat $GITHUB_ENV - - name: upload binaries - uses: softprops/action-gh-release@v1 - with: - draft: true - files: "${{ env.FILES }}" diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml deleted file mode 100644 index c206c10220..0000000000 --- a/.github/workflows/semgrep.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Semgrep -on: - # Scan changed files in PRs, block on new issues only (existing issues ignored) - pull_request: {} - push: - branches: - - main - - release/** - paths: - - .github/workflows/semgrep.yml - schedule: - - cron: '0 0 * * 0' -jobs: - # Update from: https://semgrep.dev/docs/semgrep-ci/sample-ci-configs/#github-actions - semgrep: - name: Scan - runs-on: ubuntu-latest - container: - image: returntocorp/semgrep - if: (github.actor != 'dependabot[bot]') - steps: - # Fetch project source with GitHub Actions Checkout. - - uses: actions/checkout@v3 - with: - submodules: true - # Run the "semgrep ci" command on the command line of the docker image. - - run: semgrep ci - env: - # Add the rules that Semgrep uses by setting the SEMGREP_RULES environment variable. - SEMGREP_RULES: p/golang # more at semgrep.dev/explore - SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} - # Uncomment SEMGREP_TIMEOUT to set this job's timeout (in seconds): - # Default timeout is 1800 seconds (30 minutes). - # Set to 0 to disable the timeout. - # SEMGREP_TIMEOUT: 300 diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml deleted file mode 100644 index 67c07dfbc8..0000000000 --- a/.github/workflows/sims.yml +++ /dev/null @@ -1,446 +0,0 @@ -name: Sims -# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) -# This workflow will run on main and release branches, if a .go, .mod or .sum file have been changed -on: - push: - paths-ignore: - - 'docs/**' - branches: - - main - - release/** - tags: - - "*" - pull_request: - types: auto_merge_enabled - issue_comment: - types: [created, edited] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - member: - name: Check whether it is triggered by team members with issue_comment or push or pull_request - runs-on: ubuntu-latest - permissions: - pull-requests: write - if: >- - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) || - github.event_name == 'push' || github.event_name == 'pull_request' - outputs: - valid: ${{ steps.setValid.outputs.valid }} - steps: - - uses: tspascoal/get-user-teams-membership@v1.0.2 - id: checkMember - if: github.event_name == 'issue_comment' - with: - username: ${{ github.actor }} - team: 'cronos-dev' - GITHUB_TOKEN: ${{ secrets.ORG_READ_BOT_PAT }} - - name: Comment PR for authentication failure - uses: crypto-org-chain/actions-pull-request-add-comment@master - if: (steps.checkMember.outputs.isTeamMember == 'false') && (github.event_name == 'issue_comment') - with: - message: | - Sorry only cronos-dev team member could run simulations by '/runsim'. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: set valid if it is push/pull_request event or check if it is triggered by team members with issue_comment - id: setValid - run: | - if [[ "${{ steps.checkMember.outputs.isTeamMember }}" == "true" ]]; then - echo "valid=true" >> $GITHUB_OUTPUT - elif [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "pull_request" ]]; then - echo "valid=true" >> $GITHUB_OUTPUT - else - echo "valid=false" >> $GITHUB_OUTPUT - fi - - build: - runs-on: ubuntu-latest - needs: member - permissions: - pull-requests: write - if: needs.member.outputs.valid == 'true' - outputs: - repo_name: ${{ steps.pr_data.outputs.repo_name }} - ref: ${{ steps.pr_data.outputs.ref }} - steps: - - name: Comment PR for Sim test started - uses: crypto-org-chain/actions-pull-request-add-comment@master - if: github.event_name == 'issue_comment' - with: - message: | - Simulation tests get triggered and started by `/runsim`. - Please check further progress [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Github API Request - id: request - uses: octokit/request-action@v2.0.0 - if: github.event_name == 'issue_comment' - with: - route: ${{ github.event.issue.pull_request.url }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Get Comment PR informations - id: pr_data - if: github.event_name == 'issue_comment' - env: - COMMENTBODY: ${{ github.event.comment.body }} - run: | - echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_OUTPUT - comment_hash=`echo "$COMMENTBODY" | cut -d' ' -f2` # get commit hash if any - if [[ "${comment_hash}" == "/runsim" ]]; then - echo "ref=${{ fromJson(steps.request.outputs.data).head.ref }}" >> $GITHUB_OUTPUT # use default head ref - else - echo "ref=${comment_hash}" >> $GITHUB_OUTPUT # use comment provided ref - fi - - name: Checkout Comment PR Branch - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' - with: - submodules: true - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ steps.pr_data.outputs.repo_name }} - ref: ${{ steps.pr_data.outputs.ref }} - - name: Normal check out code - uses: actions/checkout@v3 - with: - submodules: true - if: github.event_name == 'push' || github.event_name == 'pull_request' - - uses: actions/setup-go@v3 - with: - go-version: '^1.22.0' - - name: Display go version - run: go version - - run: make build - - name: Create file status_build.txt and write the job status into it - if: github.event_name == 'issue_comment' - run: | - echo ${{ job.status }} > status_build.txt - - name: Upload file status_build.txt as an artifact - if: github.event_name == 'issue_comment' - uses: actions/upload-artifact@v3 - with: - name: pass_status_build - path: status_build.txt - - install-runsim: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/setup-go@v3 - with: - go-version: '^1.22.0' - - name: Display go version - run: go version - - name: Install runsim - run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v2.1.6 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - - name: Create file status_install.txt and write the job status into it - if: github.event_name == 'issue_comment' - run: | - echo ${{ job.status }} > status_install.txt - - name: Upload file status_install.txt as an artifact - if: github.event_name == 'issue_comment' - uses: actions/upload-artifact@v3 - with: - name: pass_status_install - path: status_install.txt - - test-sim-nondeterminism: - runs-on: ubuntu-latest - timeout-minutes: 120 - needs: [build, install-runsim] - steps: - - uses: actions/setup-go@v3 - with: - go-version: '^1.22.0' - - name: Checkout Comment PR Branch - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' - with: - submodules: true - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ needs.build.outputs.repo_name }} - ref: ${{ needs.build.outputs.ref }} - - name: Normal check out code - uses: actions/checkout@v3 - if: github.event_name == 'push' || github.event_name == 'pull_request' - with: - submodules: true - - name: Display go version - run: go version - # the original repo technote-space does not include auto_merge_enabled into target events - # we can move back after this pr merged: https://github.com/technote-space/get-diff-action/pull/193 - - uses: adu-crypto/get-diff-action@gh-actions - with: - PATTERNS: | - **/**.go - go.mod - go.sum - if: github.event_name == 'push' || github.event_name == 'pull_request' - - uses: actions/cache@v2.1.6 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - if: >- - (env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) || - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) - - name: test-sim-nondeterminism - run: | - make test-sim-nondeterminism - if: >- - (env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) || - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) - - name: Create file status_sim1.txt and write the job status into it - if: github.event_name == 'issue_comment' - run: | - echo ${{ job.status }} > status_sim1.txt - - name: Upload file status_sim1.txt as an artifact - if: github.event_name == 'issue_comment' - uses: actions/upload-artifact@v3 - with: - name: pass_status_sim1 - path: status_sim1.txt - - test-sim-import-export: - runs-on: ubuntu-latest - timeout-minutes: 120 - needs: [build, install-runsim] - steps: - - uses: actions/setup-go@v3 - with: - go-version: '^1.22.0' - - name: Checkout Comment PR Branch - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' - with: - submodules: true - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ needs.build.outputs.repo_name }} - ref: ${{ needs.build.outputs.ref }} - - name: Normal check out code - uses: actions/checkout@v3 - if: github.event_name == 'push' || github.event_name == 'pull_request' - with: - submodules: true - - name: Display go version - run: go version - # the original repo technote-space does not include auto_merge_enabled into target events - # we can move back after this pr merged: https://github.com/technote-space/get-diff-action/pull/193 - - uses: adu-crypto/get-diff-action@gh-actions - with: - PATTERNS: | - **/**.go - go.mod - go.sum - if: github.event_name == 'push' || github.event_name == 'pull_request' - - uses: actions/cache@v2.1.6 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - if: >- - (env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) || - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) - - name: test-sim-import-export - run: | - make test-sim-import-export - if: >- - (env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) || - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) - - name: Create file status_sim2.txt and write the job status into it - if: github.event_name == 'issue_comment' - run: | - echo ${{ job.status }} > status_sim2.txt - - name: Upload file status_sim2.txt as an artifact - if: github.event_name == 'issue_comment' - uses: actions/upload-artifact@v3 - with: - name: pass_status_sim2 - path: status_sim2.txt - - test-sim-after-import: - runs-on: ubuntu-latest - timeout-minutes: 120 - needs: [build, install-runsim] - steps: - - uses: actions/setup-go@v3 - with: - go-version: '^1.22.0' - - name: Checkout Comment PR Branch - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' - with: - submodules: true - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ needs.build.outputs.repo_name }} - ref: ${{ needs.build.outputs.ref }} - - name: Normal check out code - uses: actions/checkout@v3 - if: github.event_name == 'push' || github.event_name == 'pull_request' - with: - submodules: true - - name: Display go version - run: go version - # the original repo technote-space does not include auto_merge_enabled into target events - # we can move back after this pr merged: https://github.com/technote-space/get-diff-action/pull/193 - - uses: adu-crypto/get-diff-action@gh-actions - with: - PATTERNS: | - **/**.go - go.mod - go.sum - if: github.event_name == 'push' || github.event_name == 'pull_request' - - uses: actions/cache@v2.1.6 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - if: >- - (env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) || - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) - - name: test-sim-after-import - run: | - make test-sim-after-import - if: >- - (env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) || - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) - - name: Create file status_sim3.txt and write the job status into it - if: github.event_name == 'issue_comment' - run: | - echo ${{ job.status }} > status_sim3.txt - - name: Upload file status_sim3.txt as an artifact - if: github.event_name == 'issue_comment' - uses: actions/upload-artifact@v3 - with: - name: pass_status_sim3 - path: status_sim3.txt - - test-sim-multi-seed-short: - runs-on: ubuntu-latest - timeout-minutes: 120 - needs: [build, install-runsim] - steps: - - uses: actions/setup-go@v3 - with: - go-version: '^1.22.0' - - name: Checkout Comment PR Branch - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' - with: - submodules: true - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ needs.build.outputs.repo_name }} - ref: ${{ needs.build.outputs.ref }} - - name: Normal check out code - uses: actions/checkout@v3 - if: github.event_name == 'push' || github.event_name == 'pull_request' - with: - submodules: true - - name: Display go version - run: go version - # the original repo technote-space does not include auto_merge_enabled into target events - # we can move back after this pr merged: https://github.com/technote-space/get-diff-action/pull/193 - - uses: adu-crypto/get-diff-action@gh-actions - with: - PATTERNS: | - **/**.go - go.mod - go.sum - if: github.event_name == 'push' || github.event_name == 'pull_request' - - uses: actions/cache@v2.1.6 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - if: >- - (env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) || - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) - - name: test-sim-multi-seed-short - run: | - make test-sim-multi-seed-short - if: >- - (env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) || - (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) - - name: Create file status_sim4.txt and write the job status into it - if: github.event_name == 'issue_comment' - run: | - echo ${{ job.status }} > status_sim4.txt - - name: Upload file status_sim4.txt as an artifact - if: github.event_name == 'issue_comment' - uses: actions/upload-artifact@v3 - with: - name: pass_status_sim4 - path: status_sim4.txt - - report-status-pr: - runs-on: ubuntu-latest - needs: [member, test-sim-nondeterminism, test-sim-import-export, test-sim-after-import, test-sim-multi-seed-short] - permissions: - pull-requests: write - if: always() && github.event_name == 'issue_comment' && needs.member.outputs.valid == 'true' - steps: - - name: Download artifact pass_status_build - uses: actions/download-artifact@v4.1.7 - continue-on-error: true - with: - name: pass_status_build - - name: Download artifact pass_status_install - uses: actions/download-artifact@v4.1.7 - continue-on-error: true - with: - name: pass_status_install - - name: Download artifact pass_status_sim1 - uses: actions/download-artifact@v4.1.7 - continue-on-error: true - with: - name: pass_status_sim1 - - name: Download artifact pass_status_sim2 - uses: actions/download-artifact@v4.1.7 - continue-on-error: true - with: - name: pass_status_sim2 - - name: Download artifact pass_status_sim3 - uses: actions/download-artifact@v4.1.7 - continue-on-error: true - with: - name: pass_status_sim3 - - name: Download artifact pass_status_sim4 - uses: actions/download-artifact@v4.1.7 - continue-on-error: true - with: - name: pass_status_sim4 - - name: Set the statuses of Jobs as output parameters - id: set_outputs - continue-on-error: true - run: | - echo "status_job01=$(> $GITHUB_OUTPUT - echo "status_job02=$(> $GITHUB_OUTPUT - echo "status_job03=$(> $GITHUB_OUTPUT - echo "status_job04=$(> $GITHUB_OUTPUT - echo "status_job05=$(> $GITHUB_OUTPUT - echo "status_job06=$(> $GITHUB_OUTPUT - - name: The sim jobs has succeed - uses: crypto-org-chain/actions-pull-request-add-comment@master - if: >- - steps.set_outputs.outputs.status_job01 == 'success' && steps.set_outputs.outputs.status_job02 == 'success' - && steps.set_outputs.outputs.status_job03 == 'success' && steps.set_outputs.outputs.status_job04 == 'success' - && steps.set_outputs.outputs.status_job05 == 'success' && steps.set_outputs.outputs.status_job06 == 'success' - with: - message: | - ✅ `/runsim` simulation test has succeeded 🎉 - Please further check [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: The sim jobs has failed - uses: crypto-org-chain/actions-pull-request-add-comment@master - if: >- - steps.set_outputs.outputs.status_job01 != 'success' || steps.set_outputs.outputs.status_job02 != 'success' - || steps.set_outputs.outputs.status_job03 != 'success' || steps.set_outputs.outputs.status_job04 != 'success' - || steps.set_outputs.outputs.status_job05 != 'success' || steps.set_outputs.outputs.status_job06 != 'success' - with: - message: | - ❌ `/runsim` simulation test has failed 😅 - Please further check [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 4984fe92e9..0000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: integration tests -on: - merge_group: - pull_request: - push: - branches: - - main - - release/** - tags: - - "*" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - integration_tests: - runs-on: ubuntu-latest - timeout-minutes: 240 - strategy: - matrix: - tests: [unmarked, ibc, ibc_rly_evm, ibc_rly_gas, ibc_timeout, ibc_update_client, ica, gov, upgrade, slow, gas] - env: - TESTS_TO_RUN: ${{ matrix.tests }} - steps: - - name: Create more disk space - run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: | - docs - *.md - **/*.md - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - if: steps.changed-files.outputs.only_changed == 'false' - - uses: cachix/cachix-action@v12 - if: steps.changed-files.outputs.only_changed == 'false' - with: - name: cronos - extraPullNames: dapp - # github don't pass secrets for pull request from fork repos, - # in that case the push is disabled naturally. - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - name: Run integration tests - if: steps.changed-files.outputs.only_changed == 'false' - run: make run-integration-tests - - name: 'Tar debug files' - if: failure() - run: tar cfz debug_files.tar.gz -C "${TMPDIR-/tmp}/pytest-of-runner" . - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: debug-files - path: debug_files.tar.gz - if-no-files-found: ignore - - name: Convert coverage data - if: steps.changed-files.outputs.only_changed == 'false' - run: | - nix profile install ./nix#go_1_22 - go tool covdata textfmt -i=integration_tests/coverage -o profile.txt - - name: Upload coverage report - if: steps.changed-files.outputs.only_changed == 'false' - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./profile.txt - flags: integration_tests - - upload-cache: - if: github.event_name == 'push' - needs: ["integration_tests"] - strategy: - matrix: - os: [macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: | - docs - *.md - **/*.md - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - if: steps.changed-files.outputs.only_changed == 'false' - - uses: cachix/cachix-action@v12 - if: steps.changed-files.outputs.only_changed == 'false' - with: - name: cronos - extraPullNames: dapp - # github don't pass secrets for pull request from fork repos, - # in that case the push is disabled naturally. - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - name: 'instantiate integration test env' - if: steps.changed-files.outputs.only_changed == 'false' - run: nix-store -r $(nix-instantiate integration_tests/shell.nix) diff --git a/go.mod b/go.mod index 22f5881c57..0c9aa50c12 100644 --- a/go.mod +++ b/go.mod @@ -271,6 +271,7 @@ replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // for go-ethereum github.com/cockroachdb/pebble => github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 + github.com/cometbft/cometbft => github.com/mmsqe/cometbft v0.34.21-0.20240903104805-9722b6dfa1d0 github.com/cometbft/cometbft-db => github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63 // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 diff --git a/go.sum b/go.sum index 2bb00018c1..f5672709ed 100644 --- a/go.sum +++ b/go.sum @@ -367,8 +367,6 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= -github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -902,6 +900,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mmsqe/cometbft v0.34.21-0.20240903104805-9722b6dfa1d0 h1:CHmUEg20M4Mb6lSTPZKH49dBBGH9VbSJ5M6DlYCeWuc= +github.com/mmsqe/cometbft v0.34.21-0.20240903104805-9722b6dfa1d0/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= diff --git a/gomod2nix.toml b/gomod2nix.toml index 3b2744bf5a..59e3d3d98c 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -157,8 +157,9 @@ schema = 3 version = "v1.0.0" hash = "sha256-z/0E0NiEGo7zxM7d94ImgUf8P0/KG6hbP9T4Vuym4p0=" [mod."github.com/cometbft/cometbft"] - version = "v0.38.12" + version = "v0.34.21-0.20240903104805-9722b6dfa1d0" hash = "sha256-xJNCwjaxXzJTXygfRZFqkESl8YsgfZyHfGy5XRYKJ2c=" + replaced = "github.com/mmsqe/cometbft" [mod."github.com/cometbft/cometbft-db"] version = "v0.0.0-20231011055109-57922ac52a63" hash = "sha256-iLs/FN1be3AcoyhKj2+b5Msqeat9j2ja4acyOs+w+Uk="