From e54be71b030a2445cdc1a02ab3b94da3abdc0e5b Mon Sep 17 00:00:00 2001 From: Quentin Mc Gaw Date: Thu, 2 Jan 2025 15:00:04 +0100 Subject: [PATCH 1/8] chore(ci): add yaml linter workflow - triggers only on yaml/yml file modifications - uses built-in yamllint with yamllint.yml configuration --- .github/workflows/yml.yml | 18 ++++++++++++++++++ .github/yamllint.yml | 12 ++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/yml.yml create mode 100644 .github/yamllint.yml diff --git a/.github/workflows/yml.yml b/.github/workflows/yml.yml new file mode 100644 index 00000000000..15ac70ffd4d --- /dev/null +++ b/.github/workflows/yml.yml @@ -0,0 +1,18 @@ +name: YAML check + +on: + pull_request: + branches: [main] + paths: + - "**/*.yml" + - "**/*.yaml" + - ".github/workflows/yml.yml" + - ".github/yamllint.yml" + +jobs: + yaml-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Validate YAML file + run: yamllint -c .github/yamllint.yml . diff --git a/.github/yamllint.yml b/.github/yamllint.yml new file mode 100644 index 00000000000..863c217e8ae --- /dev/null +++ b/.github/yamllint.yml @@ -0,0 +1,12 @@ +extends: default + +rules: + document-start: disable + line-length: disable + comments: + min-spaces-from-content: 1 + truthy: + check-keys: false +ignore: + - .travis.yml + - crypto/secp256k1/libsecp256k1/.travis.yml From e7b60e981f2b0509c1e030beffe3a80fa29a9cc9 Mon Sep 17 00:00:00 2001 From: Quentin Mc Gaw Date: Thu, 2 Jan 2025 15:01:31 +0100 Subject: [PATCH 2/8] Fix existing yml files to pass CI --- .github/workflows/go.yml | 13 +++++++------ .github/workflows/golangci-lint.yml | 4 ++-- .github/workflows/libevm-delta.yml | 11 ++++++----- .github/workflows/rename-module.yml | 6 +++--- .golangci.yml | 5 ++++- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index db48851ef50..17f887d20e1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,15 +2,15 @@ name: Go on: push: - branches: [ main, 'release/**' ] + branches: [main, "release/**"] pull_request: - branches: [ main, 'release/**' ] + branches: [main, "release/**"] workflow_dispatch: 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)$' + 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 @@ -19,15 +19,16 @@ jobs: with: go-version: 1.21.4 - name: Run flaky tests sequentially - run: | # Upstream flakes are race conditions exacerbated by concurrent tests + 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_generate: env: - EXCLUDE_REGEX: 'ava-labs/libevm/(accounts/usbwallet/trezor)$' + EXCLUDE_REGEX: "ava-labs/libevm/(accounts/usbwallet/trezor)$" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 9588e65b4df..e1f4e8b074c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -2,9 +2,9 @@ name: golangci-lint on: push: - branches: [ main, 'release/**' ] + branches: [main, "release/**"] pull_request: - branches: [ main, 'release/**' ] + branches: [main, "release/**"] workflow_dispatch: permissions: diff --git a/.github/workflows/libevm-delta.yml b/.github/workflows/libevm-delta.yml index b2d4e1c6689..791d1ee4a60 100644 --- a/.github/workflows/libevm-delta.yml +++ b/.github/workflows/libevm-delta.yml @@ -2,9 +2,9 @@ name: libevm delta on: push: - branches: [ main, 'release/**' ] + branches: [main, "release/**"] pull_request: - branches: [ main, 'release/**' ] + branches: [main, "release/**"] workflow_dispatch: jobs: @@ -18,9 +18,10 @@ jobs: with: fetch-depth: 0 # everything fetch-tags: true - + - name: Color-blindness a11y - run: | # https://davidmathlogic.com/colorblind/#%23D81B60-%231E88E5-%23FFC107-%23004D40:~:text=8%20pairs%20of%20contrasting%20colors + run: + | # https://davidmathlogic.com/colorblind/#%23D81B60-%231E88E5-%23FFC107-%23004D40:~:text=8%20pairs%20of%20contrasting%20colors git config color.diff.old "#DC3220"; git config color.diff.new "#005AB5"; @@ -31,7 +32,7 @@ jobs: ':(exclude).golangci.yml' \ ':(exclude).github/**' \ ':(exclude)README.md'; - + - name: git diff {LIBEVM_BASE}..main run: | git checkout main --; diff --git a/.github/workflows/rename-module.yml b/.github/workflows/rename-module.yml index 2f483cc0190..cb8b9dccbcd 100644 --- a/.github/workflows/rename-module.yml +++ b/.github/workflows/rename-module.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: source_commit: - description: 'Upstream commit on which to base module renaming' + description: "Upstream commit on which to base module renaming" required: true type: string - default: '2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1' + default: "2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1" jobs: rename-module: @@ -42,7 +42,7 @@ jobs: find . -type f | \ xargs grep -In github.com/ethereum/go-ethereum | \ grep -v "https://github.com/ethereum/go-ethereum" - + - name: Set up Go uses: actions/setup-go@v5 with: diff --git a/.golangci.yml b/.golangci.yml index e84912ec0d8..40636f6d998 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -57,16 +57,19 @@ linters-settings: - dot - blank goheader: - values: template-path: .libevm-header gomodguard: blocked: modules: - github.com/ethereum/go-ethereum: + reason: "" - github.com/ava-labs/avalanchego: + reason: "" - github.com/ava-labs/coreth: + reason: "" - github.com/ava-labs/subnet-evm: + reason: "" revive: rules: - name: unused-parameter From 98fe0b635fd8853a7b700e8a43849c4a482b0aa7 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sun, 12 Jan 2025 14:36:46 +0100 Subject: [PATCH 3/8] Comment on why specific yml files are ignored Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> Signed-off-by: Quentin McGaw --- .github/yamllint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/yamllint.yml b/.github/yamllint.yml index 863c217e8ae..a934fc899ac 100644 --- a/.github/yamllint.yml +++ b/.github/yamllint.yml @@ -8,5 +8,6 @@ rules: truthy: check-keys: false ignore: + # Upstream geth files that we don't want to modify unnecessarily. - .travis.yml - crypto/secp256k1/libsecp256k1/.travis.yml From bf3a406cdc1d1825b84e60e5730452ffe85d1356 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sun, 12 Jan 2025 14:39:24 +0100 Subject: [PATCH 4/8] Specify reason for blocked module ethereum/go-ethereum Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> Signed-off-by: Quentin McGaw --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 40636f6d998..6f821cd45b5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -63,7 +63,7 @@ linters-settings: blocked: modules: - github.com/ethereum/go-ethereum: - reason: "" + reason: "Original, forked repo" - github.com/ava-labs/avalanchego: reason: "" - github.com/ava-labs/coreth: From 387fffc3a3c6b6d81d88579a984f803e73a9761f Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sun, 12 Jan 2025 14:39:45 +0100 Subject: [PATCH 5/8] Specify reason for blocked module ava-labs/coreth Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> Signed-off-by: Quentin McGaw --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 6f821cd45b5..35ef3200c5f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -67,7 +67,7 @@ linters-settings: - github.com/ava-labs/avalanchego: reason: "" - github.com/ava-labs/coreth: - reason: "" + reason: "Avoid dependency loop" - github.com/ava-labs/subnet-evm: reason: "" revive: From 41cd23009d786db3efdc05309634ce99c4c2ee85 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sun, 12 Jan 2025 14:40:01 +0100 Subject: [PATCH 6/8] Specify reason for blocked module ava-labs/subnet-evm Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> Signed-off-by: Quentin McGaw --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 35ef3200c5f..6fcef2f2db1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -69,7 +69,7 @@ linters-settings: - github.com/ava-labs/coreth: reason: "Avoid dependency loop" - github.com/ava-labs/subnet-evm: - reason: "" + reason: "Avoid dependency loop" revive: rules: - name: unused-parameter From a4743cc55cf4445ee94afb631f0202fd86cf8b41 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sun, 12 Jan 2025 14:40:19 +0100 Subject: [PATCH 7/8] Specify reason for blocked module ava-labs/avalanchego Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> Signed-off-by: Quentin McGaw --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 6fcef2f2db1..1bd8c0c6902 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -65,7 +65,7 @@ linters-settings: - github.com/ethereum/go-ethereum: reason: "Original, forked repo" - github.com/ava-labs/avalanchego: - reason: "" + reason: "Avoid dependency loop" - github.com/ava-labs/coreth: reason: "Avoid dependency loop" - github.com/ava-labs/subnet-evm: From a4b5f69353e75de699e31353570f058f3abebaab Mon Sep 17 00:00:00 2001 From: Quentin Mc Gaw Date: Sun, 12 Jan 2025 14:36:00 +0100 Subject: [PATCH 8/8] Move yamlint config to .yamlint.yml --- .github/workflows/yml.yml | 4 ++-- .github/yamllint.yml => .yamllint.yml | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/yamllint.yml => .yamllint.yml (100%) diff --git a/.github/workflows/yml.yml b/.github/workflows/yml.yml index 15ac70ffd4d..de3da43dd52 100644 --- a/.github/workflows/yml.yml +++ b/.github/workflows/yml.yml @@ -14,5 +14,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Validate YAML file - run: yamllint -c .github/yamllint.yml . + - name: Validate YAML files + run: yamllint -c .yamllint.yml . diff --git a/.github/yamllint.yml b/.yamllint.yml similarity index 100% rename from .github/yamllint.yml rename to .yamllint.yml