chore: CI updates for renamed module

Linter:
- Block imports of `ethereum/go-ethereum` upstream module
- Disable `goimports` checks on upstream code

Go:
- Update flaky-test regex
- Run flaky and non-flaky tests in different steps as this makes it easier to spot incorrect regex

Upstream delta:
- Use env var in workflow instead of `libevm-base` tag -> base changes atomically with the update commit
This commit is contained in:
Arran Schlosberg 2024-10-12 12:43:14 +01:00
parent 4410f807c2
commit 5c6635282d
No known key found for this signature in database
GPG key ID: 5DD5567C12C5F312
3 changed files with 15 additions and 7 deletions

View file

@ -9,6 +9,8 @@ on:
jobs:
go_test_short:
env:
FLAKY_REGEX: 'ava-labs/libevm/(eth|eth/tracers/js|eth/tracers/logger|accounts/abi/bind|accounts/keystore|eth/downloader|miner|ethclient|ethclient/gethclient|eth/catalyst)$'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -16,8 +18,9 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.21.4
- name: Run tests
- name: Run flaky tests sequentially
run: | # Upstream flakes are race conditions exacerbated by concurrent tests
FLAKY_REGEX='go-ethereum/(eth|eth/tracers/js|eth/tracers/logger|accounts/abi/bind|accounts/keystore|eth/downloader|miner|ethclient|ethclient/gethclient|eth/catalyst)$';
go list ./... | grep -P "${FLAKY_REGEX}" | xargs -n 1 go test -short;
- name: Run non-flaky tests concurrently
run: |
go test -short $(go list ./... | grep -Pv "${FLAKY_REGEX}");

View file

@ -9,6 +9,9 @@ on:
jobs:
diffs:
env:
# Last commit on `renamed-go-module` branch to be merged into `main`
LIBEVM_BASE: a7f08d0e757d5a69d3e269c69dcea7e45bab97e3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -21,19 +24,19 @@ jobs:
git config color.diff.old "#DC3220";
git config color.diff.new "#005AB5";
- name: git diff libevm-base
- name: git diff {LIBEVM_BASE}
run: |
git diff --diff-filter=a --word-diff --unified=0 --color=always \
libevm-base \
"${LIBEVM_BASE}" \
':(exclude).golangci.yml' \
':(exclude).github/**' \
':(exclude)README.md';
- name: git diff libevm-base..main
- name: git diff {LIBEVM_BASE}..main
run: |
git checkout main --;
git diff --diff-filter=a --word-diff --unified=0 --color=always \
libevm-base \
"${LIBEVM_BASE}" \
':(exclude).golangci.yml' \
':(exclude).github/**' \
':(exclude)README.md';

View file

@ -61,13 +61,14 @@ linters-settings:
gomodguard:
blocked:
modules:
- github.com/ethereum/go-ethereum:
- github.com/ava-labs/avalanchego:
- github.com/ava-labs/coreth:
- github.com/ava-labs/subnet-evm:
revive:
rules:
- name: unused-parameter
# Method parameters may be equired by interfaces and forcing them to be
# Method parameters may be required by interfaces and forcing them to be
# named _ is of questionable benefit.
disabled: true
@ -84,6 +85,7 @@ issues:
- gci
- gofmt
- goheader
- goimports
- gosec
- gosimple
- govet