Skip to content

Commit c996175

Browse files
authored
chore(ci): yaml linter workflow and fix yaml files (#98)
- New workflow triggering only on yaml file changes using the built-in `yamllint` - `.yamllint.yml` configuration added at the root of the project - Fix existing yml files to satisfy ymllint - Ignore go-ethereum original yml files
1 parent ce2cde5 commit c996175

File tree

7 files changed

+53
-17
lines changed

7 files changed

+53
-17
lines changed

.github/workflows/go.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: Go
22

33
on:
44
push:
5-
branches: [ main, 'release/**' ]
5+
branches: [main, "release/**"]
66
pull_request:
7-
branches: [ main, 'release/**' ]
7+
branches: [main, "release/**"]
88
workflow_dispatch:
99

1010
jobs:
1111
go_test_short:
1212
env:
13-
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)$'
13+
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)$"
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
@@ -19,15 +19,16 @@ jobs:
1919
with:
2020
go-version: 1.21.4
2121
- name: Run flaky tests sequentially
22-
run: | # Upstream flakes are race conditions exacerbated by concurrent tests
22+
run:
23+
| # Upstream flakes are race conditions exacerbated by concurrent tests
2324
go list ./... | grep -P "${FLAKY_REGEX}" | xargs -n 1 go test -short;
2425
- name: Run non-flaky tests concurrently
2526
run: |
2627
go test -short $(go list ./... | grep -Pv "${FLAKY_REGEX}");
27-
28+
2829
go_generate:
2930
env:
30-
EXCLUDE_REGEX: 'ava-labs/libevm/(accounts/usbwallet/trezor)$'
31+
EXCLUDE_REGEX: "ava-labs/libevm/(accounts/usbwallet/trezor)$"
3132
runs-on: ubuntu-latest
3233
steps:
3334
- uses: actions/checkout@v4

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: golangci-lint
22

33
on:
44
push:
5-
branches: [ main, 'release/**' ]
5+
branches: [main, "release/**"]
66
pull_request:
7-
branches: [ main, 'release/**' ]
7+
branches: [main, "release/**"]
88
workflow_dispatch:
99

1010
permissions:

.github/workflows/libevm-delta.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: libevm delta
22

33
on:
44
push:
5-
branches: [ main, 'release/**' ]
5+
branches: [main, "release/**"]
66
pull_request:
7-
branches: [ main, 'release/**' ]
7+
branches: [main, "release/**"]
88
workflow_dispatch:
99

1010
jobs:
@@ -18,9 +18,10 @@ jobs:
1818
with:
1919
fetch-depth: 0 # everything
2020
fetch-tags: true
21-
21+
2222
- name: Color-blindness a11y
23-
run: | # https://davidmathlogic.com/colorblind/#%23D81B60-%231E88E5-%23FFC107-%23004D40:~:text=8%20pairs%20of%20contrasting%20colors
23+
run:
24+
| # https://davidmathlogic.com/colorblind/#%23D81B60-%231E88E5-%23FFC107-%23004D40:~:text=8%20pairs%20of%20contrasting%20colors
2425
git config color.diff.old "#DC3220";
2526
git config color.diff.new "#005AB5";
2627

@@ -31,7 +32,7 @@ jobs:
3132
':(exclude).golangci.yml' \
3233
':(exclude).github/**' \
3334
':(exclude)README.md';
34-
35+
3536
- name: git diff {LIBEVM_BASE}..main
3637
run: |
3738
git checkout main --;

.github/workflows/rename-module.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
workflow_dispatch:
55
inputs:
66
source_commit:
7-
description: 'Upstream commit on which to base module renaming'
7+
description: "Upstream commit on which to base module renaming"
88
required: true
99
type: string
10-
default: '2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1'
10+
default: "2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1"
1111

1212
jobs:
1313
rename-module:
@@ -42,7 +42,7 @@ jobs:
4242
find . -type f | \
4343
xargs grep -In github.com/ethereum/go-ethereum | \
4444
grep -v "https://github.com/ethereum/go-ethereum"
45-
45+
4646
- name: Set up Go
4747
uses: actions/setup-go@v5
4848
with:

.github/workflows/yml.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: YAML check
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- "**/*.yml"
8+
- "**/*.yaml"
9+
- ".github/workflows/yml.yml"
10+
- ".github/yamllint.yml"
11+
12+
jobs:
13+
yaml-check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Validate YAML files
18+
run: yamllint -c .yamllint.yml .

.golangci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,19 @@ linters-settings:
5757
- dot
5858
- blank
5959
goheader:
60-
values:
6160
template-path: .libevm-header
6261

6362
gomodguard:
6463
blocked:
6564
modules:
6665
- github.com/ethereum/go-ethereum:
66+
reason: "Original, forked repo"
6767
- github.com/ava-labs/avalanchego:
68+
reason: "Avoid dependency loop"
6869
- github.com/ava-labs/coreth:
70+
reason: "Avoid dependency loop"
6971
- github.com/ava-labs/subnet-evm:
72+
reason: "Avoid dependency loop"
7073
revive:
7174
rules:
7275
- name: unused-parameter

.yamllint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: default
2+
3+
rules:
4+
document-start: disable
5+
line-length: disable
6+
comments:
7+
min-spaces-from-content: 1
8+
truthy:
9+
check-keys: false
10+
ignore:
11+
# Upstream geth files that we don't want to modify unnecessarily.
12+
- .travis.yml
13+
- crypto/secp256k1/libsecp256k1/.travis.yml

0 commit comments

Comments
 (0)