2021-08-26 18:06:44 +00:00
|
|
|
name: Lint
|
2021-06-08 07:07:11 +00:00
|
|
|
# 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.
|
2020-06-26 22:26:55 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-06-08 07:07:11 +00:00
|
|
|
- main
|
2020-06-26 22:26:55 +00:00
|
|
|
jobs:
|
|
|
|
golangci:
|
2021-06-08 07:07:11 +00:00
|
|
|
name: Run golangci-lint
|
2020-06-26 22:26:55 +00:00
|
|
|
runs-on: ubuntu-latest
|
2020-07-23 19:38:47 +00:00
|
|
|
timeout-minutes: 10
|
2020-06-26 22:26:55 +00:00
|
|
|
steps:
|
2022-10-31 18:02:59 +00:00
|
|
|
# Required: setup-go, for all versions v3.0.0+ of golangci-lint
|
2022-04-05 13:00:54 +00:00
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
2022-10-31 16:46:48 +00:00
|
|
|
go-version: 1.19
|
2022-11-01 22:05:34 +00:00
|
|
|
check-latest: true
|
2022-03-03 17:07:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-10-18 13:57:31 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2020-06-26 22:26:55 +00:00
|
|
|
with:
|
2022-04-05 13:00:54 +00:00
|
|
|
PATTERNS: |
|
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
2022-10-31 18:02:59 +00:00
|
|
|
- uses: golangci/golangci-lint-action@v3.3.0
|
2020-06-26 22:26:55 +00:00
|
|
|
with:
|
2022-10-31 18:02:59 +00:00
|
|
|
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
2022-11-01 22:05:34 +00:00
|
|
|
version: latest
|
2020-06-26 22:26:55 +00:00
|
|
|
args: --timeout 10m
|
|
|
|
github-token: ${{ secrets.github_token }}
|
2021-06-08 07:07:11 +00:00
|
|
|
# Check only if there are differences in the source code
|
|
|
|
if: "env.GIT_DIFF"
|
2022-04-12 13:51:20 +00:00
|
|
|
markdown-lint:
|
|
|
|
name: Run markdown-lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-10-18 13:57:31 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2022-04-12 13:51:20 +00:00
|
|
|
with:
|
|
|
|
PATTERNS: |
|
|
|
|
docs/**/*.md
|
|
|
|
x/**/*.md
|
|
|
|
README.md
|
2022-10-31 18:02:59 +00:00
|
|
|
- uses: nosborn/github-action-markdown-cli@v3.2.0
|
|
|
|
with:
|
|
|
|
files: .
|
|
|
|
config_file: .markdownlint.yml
|
|
|
|
ignore_path: .markdownlintignore
|
2022-04-12 13:51:20 +00:00
|
|
|
# Check only if there are differences in the source code
|
|
|
|
if: env.GIT_DIFF
|
2022-08-02 06:21:03 +00:00
|
|
|
python-lint:
|
|
|
|
name: Run flake8 on python integration tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-10-18 14:52:58 +00:00
|
|
|
- uses: cachix/install-nix-action@v18
|
2022-10-28 22:43:12 +00:00
|
|
|
- uses: cachix/cachix-action@v12
|
2022-08-02 06:21:03 +00:00
|
|
|
with:
|
|
|
|
name: ethermint
|
2022-10-18 13:57:31 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2022-08-02 06:21:03 +00:00
|
|
|
with:
|
|
|
|
PATTERNS: |
|
|
|
|
**/**.py
|
|
|
|
- run: |
|
2022-08-08 08:17:10 +00:00
|
|
|
nix-shell -I nixpkgs=./nix -p test-env --run "make lint-py"
|
2022-08-02 06:21:03 +00:00
|
|
|
if: env.GIT_DIFF
|
|
|
|
gomod2nix:
|
|
|
|
name: Check gomod2nix.toml file is up to date
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2.3.4
|
2022-10-18 14:52:58 +00:00
|
|
|
- uses: cachix/install-nix-action@v18
|
2022-10-28 22:43:12 +00:00
|
|
|
- uses: cachix/cachix-action@v12
|
2022-08-02 06:21:03 +00:00
|
|
|
with:
|
|
|
|
name: ethermint
|
2022-10-31 18:02:59 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
|
|
|
with:
|
|
|
|
PATTERNS: |
|
|
|
|
**/**.py
|
2022-08-02 06:21:03 +00:00
|
|
|
- name: run gomod2nix
|
|
|
|
run: |
|
|
|
|
nix run -f ./nix gomod2nix
|
|
|
|
git diff --no-ext-diff --exit-code
|
2022-10-31 18:02:59 +00:00
|
|
|
if: env.GIT_DIFF
|