Merge pull request #14470 from serathius/verify-update
makefile: Make static analysis commands easier to usedependabot/go_modules/go.uber.org/atomic-1.10.0
commit
72912fbc20
|
@ -3,11 +3,6 @@ on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
target:
|
|
||||||
- linux-amd64-fmt
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
|
@ -17,17 +12,4 @@ jobs:
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
with:
|
with:
|
||||||
version: v1.49.0
|
version: v1.49.0
|
||||||
- run: date
|
- run: make verify
|
||||||
- env:
|
|
||||||
TARGET: ${{ matrix.target }}
|
|
||||||
run: |
|
|
||||||
echo "${TARGET}"
|
|
||||||
case "${TARGET}" in
|
|
||||||
linux-amd64-fmt)
|
|
||||||
GOARCH=amd64 PASSES='fmt bom dep' ./scripts/test.sh
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Failed to find target"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -64,10 +64,11 @@ Setup environment:
|
||||||
etcd code should follow coding style suggested by the Golang community.
|
etcd code should follow coding style suggested by the Golang community.
|
||||||
See the [style doc](https://github.com/golang/go/wiki/CodeReviewComments) for details.
|
See the [style doc](https://github.com/golang/go/wiki/CodeReviewComments) for details.
|
||||||
|
|
||||||
Please ensure that your change passes static analysis:
|
Please ensure that your change passes static analysis (requires [golangci-lint](https://golangci-lint.run/usage/install/)):
|
||||||
- `make test-fmt` to format code.
|
- `make verify` to verify if all checks pass.
|
||||||
- `make lint` to run linter (requires [golangci-lint](https://golangci-lint.run/usage/install/))
|
- `make verify-*` to verify a single check, for example `make verify-bom` to verify if bill-of-materials.json file is up-to-date.
|
||||||
- `make lint-fix` to fix linter errors (requires [golangci-lint](https://golangci-lint.run/usage/install/))
|
- `make update` to fix all checks.
|
||||||
|
- `make update-*` to fix a single checks, for example `make update-bom` to update bill-of-materials.json.
|
||||||
|
|
||||||
Please ensure that your change passes tests.
|
Please ensure that your change passes tests.
|
||||||
- `make test-unit` to run unit tests.
|
- `make test-unit` to run unit tests.
|
||||||
|
|
49
Makefile
49
Makefile
|
@ -5,13 +5,11 @@ build:
|
||||||
./bin/etcdctl version
|
./bin/etcdctl version
|
||||||
./bin/etcdutl version
|
./bin/etcdutl version
|
||||||
|
|
||||||
.PHONY: test-fmt
|
# Tests
|
||||||
test-fmt:
|
|
||||||
PASSES="fmt" ./scripts/test.sh
|
|
||||||
|
|
||||||
.PHONY: test-bom
|
.PHONY: test
|
||||||
test-bom:
|
test:
|
||||||
PASSES="bom" ./scripts/test.sh
|
PASSES="unit integration release e2e" ./scripts/test.sh
|
||||||
|
|
||||||
.PHONY: test-unit
|
.PHONY: test-unit
|
||||||
test-unit:
|
test-unit:
|
||||||
|
@ -29,16 +27,45 @@ test-e2e: build
|
||||||
test-e2e-release: build
|
test-e2e-release: build
|
||||||
PASSES="release e2e" ./scripts/test.sh
|
PASSES="release e2e" ./scripts/test.sh
|
||||||
|
|
||||||
.PHONY: test-all
|
# Static analysis
|
||||||
test-all:
|
|
||||||
PASSES="fmt bom dep unit integration release e2e" ./scripts/test.sh
|
|
||||||
|
|
||||||
lint:
|
verify: verify-fmt verify-bom verify-lint verify-dep
|
||||||
|
update: update-bom update-lint update-dep update-fix
|
||||||
|
|
||||||
|
.PHONY: verify-fmt
|
||||||
|
verify-fmt:
|
||||||
|
PASSES="fmt" ./scripts/test.sh
|
||||||
|
|
||||||
|
.PHONY: verify-bom
|
||||||
|
verify-bom:
|
||||||
|
PASSES="bom" ./scripts/test.sh
|
||||||
|
|
||||||
|
.PHONY: update-bom
|
||||||
|
update-bom:
|
||||||
|
./scripts/updatebom.sh
|
||||||
|
|
||||||
|
.PHONY: verify-dep
|
||||||
|
verify-dep:
|
||||||
|
PASSES="dep" ./scripts/test.sh
|
||||||
|
|
||||||
|
.PHONY: update-dep
|
||||||
|
update-dep:
|
||||||
|
./scripts/update_dep.sh
|
||||||
|
|
||||||
|
.PHONY: verify-lint
|
||||||
|
verify-lint:
|
||||||
golangci-lint run
|
golangci-lint run
|
||||||
|
|
||||||
lint-fix:
|
.PHONY: update-lint
|
||||||
|
update-lint:
|
||||||
golangci-lint run --fix
|
golangci-lint run --fix
|
||||||
|
|
||||||
|
.PHONY: update-fix
|
||||||
|
update-fix:
|
||||||
|
./scripts/fix.sh
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f ./codecov
|
rm -f ./codecov
|
||||||
rm -rf ./covdir
|
rm -rf ./covdir
|
||||||
|
|
Loading…
Reference in New Issue