|
| 1 | +name: Lint |
| 2 | +# Lint runs golangci-lint over the entire ethermint repository This workflow is |
| 3 | +# run on every pull request and push to main The `golangci` will pass without |
| 4 | +# running if no *.{go, mod, sum} files have been changed. |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - master |
| 10 | +jobs: |
| 11 | + golangci: |
| 12 | + name: Run golangci-lint |
| 13 | + runs-on: ubuntu-latest |
| 14 | + timeout-minutes: 10 |
| 15 | + steps: |
| 16 | + # Required: setup-go, for all versions v3.0.0+ of golangci-lint |
| 17 | + - uses: actions/setup-go@v3 |
| 18 | + with: |
| 19 | + go-version: 1.19 |
| 20 | + check-latest: true |
| 21 | + - uses: actions/checkout@v3 |
| 22 | + - uses: technote-space/[email protected] |
| 23 | + with: |
| 24 | + PATTERNS: | |
| 25 | + **/**.go |
| 26 | + go.mod |
| 27 | + go.sum |
| 28 | + - uses: golangci/[email protected] |
| 29 | + with: |
| 30 | + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. |
| 31 | + version: latest |
| 32 | + args: --timeout 10m |
| 33 | + github-token: ${{ secrets.github_token }} |
| 34 | + # Check only if there are differences in the source code |
| 35 | + if: env.GIT_DIFF |
| 36 | + markdown-lint: |
| 37 | + name: Run markdown-lint |
| 38 | + runs-on: ubuntu-latest |
| 39 | + timeout-minutes: 10 |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v3 |
| 42 | + - uses: technote-space/[email protected] |
| 43 | + with: |
| 44 | + PATTERNS: | |
| 45 | + docs/**/*.md |
| 46 | + x/**/*.md |
| 47 | + README.md |
| 48 | + |
| 49 | + with: |
| 50 | + files: . |
| 51 | + config_file: .markdownlint.yml |
| 52 | + ignore_path: .markdownlintignore |
| 53 | + # Check only if there are differences in the source code |
| 54 | + if: env.GIT_DIFF |
| 55 | + gomod2nix: |
| 56 | + name: Check gomod2nix.toml file is up to date |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + |
| 60 | + - uses: cachix/install-nix-action@v18 |
| 61 | + - uses: cachix/cachix-action@v12 |
| 62 | + with: |
| 63 | + name: ethermint |
| 64 | + - uses: technote-space/[email protected] |
| 65 | + with: |
| 66 | + PATTERNS: | |
| 67 | + **/**.py |
| 68 | + - name: run gomod2nix |
| 69 | + run: | |
| 70 | + nix run -f ./nix gomod2nix |
| 71 | + git diff --no-ext-diff --exit-code |
| 72 | + if: env.GIT_DIFF |
0 commit comments