switching to PAT to write to brew tap #10
This file contains 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
name: go-checks | |
on: | |
workflow_call: | |
push: | |
branches: [ main ] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [ main ] | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 | |
- name: Setup Go environment | |
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # pin@v5 | |
with: | |
go-version: '1.22' | |
check-latest: true | |
- name: Run Vulncheck | |
run: | | |
go install golang.org/x/vuln/cmd/govulncheck@latest | |
govulncheck ./... | |
- name: Download linter config | |
run: curl -fsS -o .golangci.yml https://raw.githubusercontent.com/fortio/workflows/main/golangci.yml | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # pin@v6 | |
- name: Run tests | |
run: | | |
go version | |
go run . buildinfo || true # to also confirm go toolchain version used | |
if make -n test &>/dev/null; then | |
echo "Running tests with make test" | |
make test | |
else | |
echo "No Makefile test target, running tests with race detection as default behavior" | |
go test -race ./... | |
fi |