forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 3
chore(ci): merge go and lint workflows and jobs together #144
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Draft
qdm12
wants to merge
5
commits into
main
Choose a base branch
from
qdm12/ci/merge-jobs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4ad46fb
chore(ci): remove step names when it's obvious without
qdm12 57bca30
Split Go jobs in libevm and tooling
qdm12 1007f65
Merge lint jobs together
qdm12 9d3b8c5
Merge lint job into Go workflow jobs
qdm12 9669aac
Apply goheader fix from default branch
qdm12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,78 +11,78 @@ concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
permissions: | ||
# Required: allow read access to the content for analysis. | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` linter option. | ||
pull-requests: read | ||
|
||
jobs: | ||
# If adding a new job, add it to the `needs` list of the `go` job as this is | ||
# what gates PRs. | ||
go: | ||
runs-on: ubuntu-latest | ||
needs: [go_test_short, go_test_tooling, go_generate, go_tidy] | ||
needs: [libevm, tooling] | ||
steps: | ||
- run: echo "Dependencies successful" | ||
|
||
go_test_short: | ||
libevm: | ||
runs-on: ubuntu-latest | ||
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 | ||
|
||
- run: yamllint -c .yamllint.yml . | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: "go.mod" | ||
go-version-file: go.mod | ||
|
||
- run: go mod tidy | ||
- name: Run `go generate` | ||
run: go list ./... | grep -Pv "${EXCLUDE_REGEX}" | xargs go generate; | ||
- run: git diff --exit-code | ||
|
||
- name: goheader | ||
if: ${{ github.event_name == 'pull_request' }} | ||
# The goheader linter is only enabled in the CI so that it runs only on modified or new files | ||
# (see only-new-issues: true). It is disabled in .golangci.yml because | ||
# golangci-lint running locally is not aware of new/modified files compared to the base | ||
# commit of a pull request, and we want to avoid reporting invalid goheader errors. | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.60 | ||
only-new-issues: true | ||
args: --enable-only goheader | ||
|
||
- uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.60 | ||
|
||
- 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}"); | ||
run: go test -short $(go list ./... | grep -Pv "${FLAKY_REGEX}"); | ||
|
||
go_test_tooling: | ||
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 | ||
- uses: ludeeus/action-shellcheck@2.0.0 | ||
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 | ||
scandir: "./libevm" | ||
|
||
go_tidy: | ||
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 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: "${{ matrix.dir }}/go.mod" | ||
go-version-file: ./libevm/tooling/go.mod | ||
|
||
- run: go mod tidy | ||
- run: go generate ./... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: this was added, in case we add |
||
- run: git diff --exit-code | ||
|
||
- run: go test ./... |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
?