mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-23 15:14:32 +00:00
## Why this should be merged Closes #25 ## How this works See https://github.com/ava-labs/libevm/discussions/126. The code is in a new module to (a) avoid polluting the root `go.mod` file and (b) because `go-git` requires a newer version of Go. Unfortunately `go-git` doesn't support cherry-picking yet so a Bash script had to be used for that bit `#!/sad`. ## How this was tested Inspection of output when running `cherrypick.sh` (with `set -x` added) from the current branch. ``` ... ... + CHERRY_PICKS='2bd6bd01d2e8561dd7fc21b631f4a34ac16627a199bbbc02771e9bf2a09e69f815f6f5e4b8058d5a34b46a2f75159fb1a1dbda71839a270a353bac92e3108e4b74fb0eefec29' ... Skipping2bd6bd01d2already in history ... Cherry-picking99bbbc0277... Cherry-picking1e9bf2a09e... Cherry-picking69f815f6f5... Cherry-pickinge4b8058d5a... Cherry-picking34b46a2f75... Cherry-picking159fb1a1db... Cherry-pickingda71839a27... + git cherry-pick99bbbc02771e9bf2a09e69f815f6f5e4b8058d5a34b46a2f75159fb1a1dbda71839a27```
88 lines
2.4 KiB
YAML
88 lines
2.4 KiB
YAML
name: Go
|
|
|
|
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:
|
|
go_test_short:
|
|
env:
|
|
FLAKY_REGEX: "ava-labs/libevm/(triedb/pathdb|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
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: "go.mod"
|
|
- name: Run flaky tests sequentially
|
|
run:
|
|
| # Upstream flakes are race conditions exacerbated by concurrent tests
|
|
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}");
|
|
|
|
go_test_tooling:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./libevm/tooling
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # everything
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: "./libevm/tooling/go.mod"
|
|
- run: go test ./...
|
|
|
|
go_generate:
|
|
env:
|
|
EXCLUDE_REGEX: "ava-labs/libevm/(accounts/usbwallet/trezor)$"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: "go.mod"
|
|
|
|
- name: Run `go generate`
|
|
run: go list ./... | grep -Pv "${EXCLUDE_REGEX}" | xargs go generate;
|
|
|
|
- name: git diff
|
|
run: git diff --exit-code
|
|
|
|
go_tidy_matrix:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
dir: ["./", "./libevm/tooling"]
|
|
defaults:
|
|
run:
|
|
working-directory: ${{ matrix.dir }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: "${{ matrix.dir }}/go.mod"
|
|
- run: go mod tidy
|
|
- run: git diff --exit-code
|
|
|
|
go_tidy:
|
|
# Each matrix instance runs as a different name, which doesn't play nicely
|
|
# with branch-protection rules. We instead require this job.
|
|
needs: go_tidy_matrix
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo "I'm a no-op"
|