mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
* Add `goimports` lint. * Fix `goimports` issue. * Fix group to `github.com/scroll-tech/go-thereum`.
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
on: [pull_request]
|
|
name: Continuous Integration
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17.x
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- name: Lint
|
|
run: |
|
|
rm -rf $HOME/.cache/golangci-lint
|
|
make lint
|
|
- name: Test
|
|
run: |
|
|
go get ./...
|
|
make test
|
|
- name: Upload coverage report
|
|
run: bash <(curl -s https://codecov.io/bash)
|
|
goimports-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17.x
|
|
- name: Install goimports
|
|
run: go get golang.org/x/tools/cmd/goimports
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
- run: goimports -local github.com/scroll-tech/go-ethereum/ -w .
|
|
- run: go mod tidy
|
|
# If there are any diffs from goimports or go mod tidy, fail.
|
|
- name: Verify no changes from goimports and go mod tidy
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
exit 1
|
|
fi
|