mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 05:41:35 +00:00
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
This commit is contained in:
parent
ce2cde5662
commit
c996175b46
7 changed files with 53 additions and 17 deletions
13
.github/workflows/go.yml
vendored
13
.github/workflows/go.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
4
.github/workflows/golangci-lint.yml
vendored
4
.github/workflows/golangci-lint.yml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
11
.github/workflows/libevm-delta.yml
vendored
11
.github/workflows/libevm-delta.yml
vendored
|
|
@ -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 --;
|
||||
|
|
|
|||
6
.github/workflows/rename-module.yml
vendored
6
.github/workflows/rename-module.yml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
18
.github/workflows/yml.yml
vendored
Normal file
18
.github/workflows/yml.yml
vendored
Normal file
|
|
@ -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 files
|
||||
run: yamllint -c .yamllint.yml .
|
||||
|
|
@ -57,16 +57,19 @@ linters-settings:
|
|||
- dot
|
||||
- blank
|
||||
goheader:
|
||||
values:
|
||||
template-path: .libevm-header
|
||||
|
||||
gomodguard:
|
||||
blocked:
|
||||
modules:
|
||||
- github.com/ethereum/go-ethereum:
|
||||
reason: "Original, forked repo"
|
||||
- github.com/ava-labs/avalanchego:
|
||||
reason: "Avoid dependency loop"
|
||||
- github.com/ava-labs/coreth:
|
||||
reason: "Avoid dependency loop"
|
||||
- github.com/ava-labs/subnet-evm:
|
||||
reason: "Avoid dependency loop"
|
||||
revive:
|
||||
rules:
|
||||
- name: unused-parameter
|
||||
|
|
|
|||
13
.yamllint.yml
Normal file
13
.yamllint.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
extends: default
|
||||
|
||||
rules:
|
||||
document-start: disable
|
||||
line-length: disable
|
||||
comments:
|
||||
min-spaces-from-content: 1
|
||||
truthy:
|
||||
check-keys: false
|
||||
ignore:
|
||||
# Upstream geth files that we don't want to modify unnecessarily.
|
||||
- .travis.yml
|
||||
- crypto/secp256k1/libsecp256k1/.travis.yml
|
||||
Loading…
Reference in a new issue