Files
etcd/.github/workflows/static-analysis.yaml
Ivan Valdes cdf03d641a github/workflows: remove golangci-lint-action step from static-analysis
The golangci-lint-action step runs only on the repository's top-level
directory. Then, make verify reruns it on the same directory, which is
redundant.

However, to keep make verify target working, golangci-lint needs to be
installed locally.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2024-05-05 20:16:09 -07:00

47 lines
1.3 KiB
YAML

---
name: Static Analysis
on: [push, pull_request]
permissions: read-all
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ steps.goversion.outputs.goversion }}
- run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@"$(cd tools/mod && go list -m -f {{.Version}} github.com/golangci/golangci-lint)"
- name: protoc
uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0
with:
version: '3.20.3'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: |
set -euo pipefail
cargo install marker --version 0.9.0
- run: |
set -euo pipefail
make verify
- run: |
set -euo pipefail
make fix
DIFF=$(git status --porcelain)
if [ -n "$DIFF" ]; then
echo "These files were modified:"
echo
echo "$DIFF"
echo
exit 1
fi