From 5c6635282d8dda1afe8117edbc0e1c3215cb6e94 Mon Sep 17 00:00:00 2001 From: Arran Schlosberg Date: Sat, 12 Oct 2024 12:43:14 +0100 Subject: [PATCH] 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 --- .github/workflows/go.yml | 7 +++++-- .github/workflows/libevm-delta.yml | 11 +++++++---- .golangci.yml | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e79c211a4265..0b472cc0b906 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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}"); diff --git a/.github/workflows/libevm-delta.yml b/.github/workflows/libevm-delta.yml index 01caed2ced2c..1c7cfe52e2c8 100644 --- a/.github/workflows/libevm-delta.yml +++ b/.github/workflows/libevm-delta.yml @@ -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'; diff --git a/.golangci.yml b/.golangci.yml index 6d181550500b..21f9499455a2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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