From 907b061404731a2928075c6fbe9fcc76ca8642fd Mon Sep 17 00:00:00 2001 From: ranupthestairs Date: Wed, 29 Sep 2021 11:48:31 +0200 Subject: [PATCH] ci: Github actions imported (#6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Readme updated, github actions added * gofumpt changes * removed old tests * Update .github/CODEOWNERS Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- .dockerignore | 5 + .gitattributes | 8 ++ .github/CODEOWNERS | 4 + .github/ISSUE_TEMPLATE/bug-report.md | 18 ++++ .github/ISSUE_TEMPLATE/feature-request.md | 15 +++ .github/PULL_REQUEST_TEMPLATE.md | 34 +++++++ .github/dependabot.yml | 28 ++++++ .github/labeler.yml | 37 ++++++++ .github/workflows/build-docs.yml | 29 ++++++ .github/workflows/build.yml | 29 ++++++ .github/workflows/clean-artifacts.yml | 19 ++++ .github/workflows/codeql-analysis.yml | 71 ++++++++++++++ .github/workflows/goreleaser.yml | 27 ++++++ .github/workflows/labeler.yml | 14 +++ .github/workflows/linkchecker.yml | 12 +++ .github/workflows/lint.yml | 30 ++++++ .github/workflows/proto.yml | 30 ++++++ .github/workflows/stale.yml | 21 +++++ .github/workflows/test.yml | 56 +++++++++++ .golangci.yml | 84 +++++++++++++++++ .goreleaser.yml | 109 ++++++++++++++++++++++ .mergify.yml | 10 ++ app/app.go | 5 +- app/export.go | 1 - cmd/evmosd/root.go | 1 - contrib/scripts/test_localnet_liveness.sh | 51 ---------- 26 files changed, 692 insertions(+), 56 deletions(-) create mode 100644 .dockerignore create mode 100644 .gitattributes create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/feature-request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/build-docs.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/clean-artifacts.yml create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/linkchecker.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/proto.yml create mode 100644 .github/workflows/stale.yml create mode 100644 .github/workflows/test.yml create mode 100644 .golangci.yml create mode 100644 .goreleaser.yml create mode 100644 .mergify.yml delete mode 100755 contrib/scripts/test_localnet_liveness.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..dacc629 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +# localnet-setup +localnet-setup + +# build +build \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..eb6e897 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +client/docs/swagger-ui/* linguist-vendored +client/docs/statik/* linguist-vendored +third-party/* linguist-vendored +client/docs/* linguist-documentation +docs/* linguist-documentation +x/**/spec/* linguist-documentation +**/*.pb.go linguist-generated +**/*.pb.gw.go linguist-generated \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..fc02102 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +# CODEOWNERS: https://help.github.com/articles/about-codeowners/ + +# Primary repo maintainers +* @fedekunze @khoslaventures @jolube diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..34150f7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,18 @@ +--- +name: Bug Report +about: create a bug report +--- + +__System info:__ [Include Ethermint commit, operating system name, and other relevant details] + +__Steps to reproduce:__ + +1. [First Step] +2. [Second Step] +3. [and so on...] + +__Expected behavior:__ [What you expected to happen] + +__Actual behavior:__ [What actually happened] + +__Additional info:__ [Include gist of relevant config, logs, etc.] diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..8095f8b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,15 @@ +--- +name: Feature request +about: Opening a feature request kicks off a discussion + +--- + +__Proposal:__ [Description of the feature] + +__Current behavior:__ [What currently happens] + +__Desired behavior:__ [What you would like to happen] + +__Use case:__ [Why is this important (helps with prioritizing requests)] + +Requests may be closed if we're not actively planning to work on them. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..6dd37f7 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,34 @@ + + +Closes: #XXX + +## Description + + + +______ + +For contributor use: + +- [ ] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) +- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. +- [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). +- [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) +- [ ] Updated relevant documentation (`docs/`) or specification (`x//spec/`) +- [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). +- [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` +- [ ] Re-reviewed `Files changed` in the Github PR explorer + +______ + +For admin use: + +- [ ] Added appropriate labels to PR (ex. `WIP`, `R4R`, `docs`, etc) +- [ ] Reviewers assigned +- [ ] Squashed all commits, uses message "Merge pull request #XYZ: [title]" ([coding standards](https://github.com/tendermint/coding/blob/master/README.md#merging-a-pr)) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9457055 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,28 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: "10:00" + open-pull-requests-limit: 10 + reviewers: + - fedekunze + - khoslaventures + labels: + - dependencies +- package-ecosystem: docker + directory: "/" + schedule: + interval: daily + time: "10:00" + open-pull-requests-limit: 10 + reviewers: + - fedekunze + - khoslaventures +- package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + time: "10:00" + open-pull-requests-limit: 10 diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..039e809 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,37 @@ +"C:Crypto": + - crypto/**/* +"C:Encoding": + - encoding/**/* +"C:JSON-RPC": + - ethereum/rpc/**/* +"C:Proto": + - proto/**/* + - third_party/**/* + - /**/*.pb.go + - /**/*.pb.gw.go +"C:Types": + - types/**/* +"C:x/evm": + - x/evm/**/*/ +"Type: Build": + - Makefile + - Dockerfile + - docker-compose.yml + - scripts/* + - config.yml +"Type: CI": + - .github/**/*.yml + - buf.yaml + - .mergify.yml + - .golangci.yml +"C:CLI": + - client/**/* + - x/*/client/**/* +"Type: Tests": + - tests/**/* + - /**/*/*_test.go +"Type: Docs": + - docs/**/* + - x/*/spec/**/* +"Type: ADR": + - docs/architecture/**/* \ No newline at end of file diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 0000000..505bf7c --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,29 @@ +name: Docs build +# This workflow runs when a PR is labeled with `docs` +# This will check if the docs build successfully by running `npm run build` +on: + pull_request: + push: + branches: + - main + - release/* + +jobs: + check-docs-build: + name: Check docs build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + with: + persist-credentials: false + fetch-depth: 0 + - uses: technote-space/get-diff-action@v5 + id: git_diff + with: + PATTERNS: | + docs/* + SUFFIX_FILTER: | + .md + - name: Install dependencies and build docs 🧱 + run: | + make build-docs \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3ac405d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: Build +on: + pull_request: + branches: + - main + +jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + - uses: technote-space/get-diff-action@v5 + id: git_diff + with: + SUFFIX_FILTER: | + .go + .mod + .sum + - run: | + make build + if: "env.GIT_DIFF != ''" diff --git a/.github/workflows/clean-artifacts.yml b/.github/workflows/clean-artifacts.yml new file mode 100644 index 0000000..6cd244d --- /dev/null +++ b/.github/workflows/clean-artifacts.yml @@ -0,0 +1,19 @@ +name: Remove old artifacts +# Remove old artifacts runs a crob job that removes old artifacts +# generated from the split tests workflow. + +on: + schedule: + # Every day at 1am + - cron: "0 1 * * *" + +jobs: + remove-old-artifacts: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Remove old artifacts + uses: c-hive/gha-remove-artifacts@v1.2.0 + with: + age: "7 days" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..bf4d11a --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,71 @@ +# 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 ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ main ] + schedule: + - cron: '37 21 * * 4' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go', 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # 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@v1 + + # ℹ️ 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@v1 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..9daa5f2 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,27 @@ +name: goreleaser + +on: + push: + tags: + - "v*.*.*" +jobs: + goreleaser: + runs-on: ubuntu-latest + environment: release + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - name: release dry run + run: make release-dry-run + - name: setup release environment + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: |- + echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' > .release-env + - name: release publish + run: make release \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..c1597dc --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,14 @@ +name: "Pull Request Labeler" +on: + pull_request: + push: + branches: + - main + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v3 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml new file mode 100644 index 0000000..6c745ea --- /dev/null +++ b/.github/workflows/linkchecker.yml @@ -0,0 +1,12 @@ +name: Check Markdown links +on: + schedule: + - cron: "* */24 * * *" +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 + with: + folder-path: "docs" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..ad53bee --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +name: Lint +# Lint runs golangci-lint over the entire ethermint repository This workflow is +# run on every pull request and push to main The `golangci` will pass without +# running if no *.{go, mod, sum} files have been changed. +on: + pull_request: + push: + branches: + - main +jobs: + golangci: + name: Run golangci-lint + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v2.3.4 + - uses: technote-space/get-diff-action@v5 + with: + SUFFIX_FILTER: | + .go + .mod + .sum + - uses: golangci/golangci-lint-action@v2.5.2 + with: + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: v1.29 + args: --timeout 10m + github-token: ${{ secrets.github_token }} + # Check only if there are differences in the source code + if: "env.GIT_DIFF" diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml new file mode 100644 index 0000000..4ec3b07 --- /dev/null +++ b/.github/workflows/proto.yml @@ -0,0 +1,30 @@ +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: + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@master + - uses: technote-space/get-diff-action@v5 + with: + PATTERNS: | + **/**.proto + - name: lint + run: make proto-lint + if: env.GIT_DIFF + breakage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: technote-space/get-diff-action@v5 + with: + PATTERNS: | + **/**.proto + - name: check-breakage + run: make proto-check-breaking + if: env.GIT_DIFF diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..9095437 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,21 @@ +name: "Close stale issues & pull requests" +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v4 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-pr-message: "This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed in 7 days-before-close if no further activity occurs." + stale-issue-message: "This issue is stale because it has been open 45 days with no activity. Remove `Status: Stale` label or comment or this will be closed in 7 days." + days-before-stale: 45 + days-before-close: 7 + exempt-issue-labels: "Status: Blocked, Type: Bug, pinned, automerge" + exempt-pr-labels: "Status: Blocked, Type: Bug, pinned, automerge" + stale-pr-label: "Status: Stale" + stale-issue-label: "Status: Stale" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a2af4d8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,56 @@ +name: Tests +on: + pull_request: + push: + branches: + - main + - release/** + +jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" + + install-tparse: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v2.1.4 + with: + go-version: 1.17 + - name: Display Go Version + run: go version + - name: Install tparse + run: | + export GO111MODULE="on" && go get github.com/mfridman/tparse@latest + - uses: actions/cache@v2.1.6 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-tparse-binary + + test-unit-cover: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v2.1.4 + with: + go-version: 1.17 + - uses: actions/checkout@v2.3.4 + - uses: technote-space/get-diff-action@v5 + with: + PATTERNS: | + **/**.sol + **/**.go + go.mod + go.sum + - name: Test and Create Coverage Report + run: | + make test-unit-cover + if: env.GIT_DIFF + - uses: codecov/codecov-action@v2.1.0 + with: + file: ./coverage.txt + fail_ci_if_error: true + if: env.GIT_DIFF diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..ee11b12 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,84 @@ +run: + tests: false + # timeout for analysis, e.g. 30s, 5m, default is 1m + # timeout: 5m + +linters: + enable: + - bodyclose + - deadcode + - depguard + - dogsled + - dupl + - errcheck + - goconst + - gocritic + - gofmt + - goimports + - golint + - gosec + - gosimple + - govet + - ineffassign + # - lll TODO: enable + - misspell + - maligned + - nakedret + - prealloc + - scopelint + - staticcheck + - structcheck + - stylecheck + - typecheck + - unconvert + - unparam + - unused + - varcheck + - nolintlint + - asciicheck + # - exhaustive + - exportloopref + - gofumpt + - gomodguard + # - nestif + # - nlreturn + - noctx + - rowserrcheck + # - whitespace + # - wsl + +issues: + exclude-rules: + - path: _test\.go + linters: + - gosec + - linters: + - lll + source: "https://" + max-same-issues: 50 + +linters-settings: + dogsled: + max-blank-identifiers: 3 + golint: + min-confidence: 0 + maligned: + suggest-new: true + misspell: + locale: US + nolintlint: + allow-unused: false + allow-leading-space: true + require-explanation: false + require-specific: false + gofumpt: + lang-version: "1.17" + gomodguard: + blocked: + versions: # List of blocked module version constraints + - https://github.com/etcd-io/etcd: # Blocked module with version constraint + version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons + reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional) + - https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint + version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons + reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional) diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..e63e016 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,109 @@ +before: + hooks: + - go mod download + +builds: + - id: "ethermintd-darwin" + main: ./cmd/ethermintd + binary: bin/ethermintd + env: + - CGO_ENABLED=1 + - CC=o64-clang + - CXX=o64-clang++ + goos: + - darwin + goarch: + - amd64 + flags: + - -tags=cgo + ldflags: + - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} + - id: "ethermintd-darwin-arm64" + main: ./cmd/ethermintd + binary: bin/ethermintd + env: + - CGO_ENABLED=1 + - CC=oa64-clang + - CXX=oa64-clang++ + goos: + - darwin + goarch: + - arm64 + flags: + - -tags=cgo + ldflags: + - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} + - id: "ethermintd-linux" + main: ./cmd/ethermintd + binary: bin/ethermintd + env: + - CGO_ENABLED=1 + - CC=gcc + - CXX=g++ + goos: + - linux + goarch: + - amd64 + flags: + - -tags=cgo + ldflags: + - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} + - id: "ethermintd-linux-arm64" + main: ./cmd/ethermintd + binary: bin/ethermintd + env: + - CGO_ENABLED=1 + - CC=aarch64-linux-gnu-gcc + - CXX=aarch64-linux-gnu-g++ + goos: + - linux + goarch: + - arm64 + flags: + - -tags=cgo + ldflags: + - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} + - id: "ethermintd-windows" + main: ./cmd/ethermintd + binary: bin/ethermintd + env: + - CGO_ENABLED=1 + - CC=x86_64-w64-mingw32-gcc + - CXX=x86_64-w64-mingw32-g++ + goos: + - windows + goarch: + - amd64 + flags: + - -tags=cgo + - -buildmode=exe + ldflags: + - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} + +archives: +- name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' + replacements: + darwin: Darwin + linux: Linux + windows: Windows + amd64: x86_64 + format_overrides: + - goos: windows + format: zip + builds: + - ethermintd-darwin + - ethermintd-darwin-arm64 + - ethermintd-windows + - ethermintd-linux + - ethermintd-linux-arm64 + +checksum: + name_template: 'checksums.txt' +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +snapshot: + name_template: "{{ .Tag }}-next" diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 0000000..69eb476 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,10 @@ +pull_request_rules: + - name: automerge to base branch with label automerge and branch protection passing + conditions: + - "#approved-reviews-by>1" + - base=main + - label=automerge + actions: + merge: + method: squash + strict: true diff --git a/app/app.go b/app/app.go index 1f2e4d4..1b07830 100644 --- a/app/app.go +++ b/app/app.go @@ -236,7 +236,6 @@ func NewEvmos( appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *Evmos { - appCodec := encodingConfig.Marshaler cdc := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry @@ -388,7 +387,7 @@ func NewEvmos( // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment // we prefer to be more strict in what arguments the modules expect. - var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) + skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) // NOTE: Any module instantiated in the module manager that is later modified // must be passed by reference here. @@ -467,7 +466,7 @@ func NewEvmos( // create the simulation manager and define the order of the modules for deterministic simulations - //NOTE: this is not required apps that don't use the simulator for fuzz testing + // NOTE: this is not required apps that don't use the simulator for fuzz testing // transactions app.sm = module.NewSimulationManager( auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), diff --git a/app/export.go b/app/export.go index a3799cc..54d5ce5 100644 --- a/app/export.go +++ b/app/export.go @@ -27,7 +27,6 @@ func NewDefaultGenesisState() simapp.GenesisState { func (app *Evmos) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error) { - // Creates context with current height and checks txs for ctx to be usable by start of next block ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) diff --git a/cmd/evmosd/root.go b/cmd/evmosd/root.go index 2e1f6c8..3f7c732 100644 --- a/cmd/evmosd/root.go +++ b/cmd/evmosd/root.go @@ -241,7 +241,6 @@ func (a appCreator) appExport( logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions, ) (servertypes.ExportedApp, error) { - var evmosApp *app.Evmos homePath, ok := appOpts.Get(flags.FlagHome).(string) if !ok || homePath == "" { diff --git a/contrib/scripts/test_localnet_liveness.sh b/contrib/scripts/test_localnet_liveness.sh deleted file mode 100755 index f099b6b..0000000 --- a/contrib/scripts/test_localnet_liveness.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -CNT=0 -ITER=$1 -SLEEP=$2 -NUMBLOCKS=$3 -NODEADDR=$4 - -if [ -z "$1" ]; then - echo "Invalid argument: missing number of iterations" - echo "sh test_localnet_liveness.sh " - exit 1 -fi - -if [ -z "$2" ]; then - echo "Invalid argument: missing sleep duration" - echo "sh test_localnet_liveness.sh " - exit 1 -fi - -if [ -z "$3" ]; then - echo "Invalid argument: missing number of blocks" - echo "sh test_localnet_liveness.sh " - exit 1 -fi - -if [ -z "$4" ]; then - echo "Invalid argument: missing node address" - echo "sh test_localnet_liveness.sh " - exit 1 -fi - -docker_containers=($(docker ps -q -f name=evmosd --format='{{.Names}}')) - -while [ ${CNT} -lt $ITER ]; do - curr_block=$(curl -s $NODEADDR:26657/status | jq -r '.result.sync_info.latest_block_height') - - if [ ! -z ${curr_block} ]; then - echo "Current block: ${curr_block}" - fi - - if [ ! -z ${curr_block} ] && [ ${curr_block} -gt ${NUMBLOCKS} ]; then - echo "Success: number of blocks reached" - exit 0 - fi - - sleep $SLEEP -done - -echo "Failed: timeout reached" -exit 1 \ No newline at end of file