chore(ci): consolidate linters (#139)

## Why this should be merged

Branch-protection rules only require the Go linter (erroneously called
`lint`) by mistake. All linters are now dependencies of a single `lint`
job that remains as a PR gate. New linters will now be enforced by
default.

Closes #138 

## How this works

GitHub Actions `need` configuration. The path limitation of running
`yamllint` is removed because it's such a cheap job so is ok to always
run.

## How this was tested

Inspection of CI run and PR's required jobs:


![image](https://github.com/user-attachments/assets/9454ca35-8a7f-4393-bdd8-5029cfaaf7e6)


![image](https://github.com/user-attachments/assets/e92b964d-5a64-415d-b8a3-1e9c84af3060)
This commit is contained in:
Arran Schlosberg 2025-02-14 16:48:55 +00:00 committed by GitHub
parent 00c10cf539
commit bc42e5f29c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 48 deletions

View file

@ -85,4 +85,4 @@ jobs:
needs: go_tidy_matrix
runs-on: ubuntu-latest
steps:
- run: echo "I'm a no-op"
- run: echo "Dependencies successful"

View file

@ -1,4 +1,7 @@
name: golangci-lint
name: lint
# If adding a new linter: (a) create a new job; and (b) add it to the `needs`
# list of the `lint` job as this is what gates PRs.
on:
push:
@ -18,8 +21,13 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
golangci:
name: lint
lint:
runs-on: ubuntu-latest
needs: [golangci-lint, yamllint, shellcheck]
steps:
- run: echo "Dependencies successful"
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -40,3 +48,18 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: yamllint -c .yamllint.yml .
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: './libevm'

View file

@ -1,22 +0,0 @@
name: shellcheck
on:
push:
branches: [main, "release/**"]
pull_request:
branches: [main, "release/**"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: './libevm'

View file

@ -1,22 +0,0 @@
name: YAML check
on:
pull_request:
branches: [main]
paths:
- "**/*.yml"
- "**/*.yaml"
- ".github/workflows/yml.yml"
- ".github/yamllint.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
yaml-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate YAML files
run: yamllint -c .yamllint.yml .