ci: pin GitHub Actions (with pinact) #12
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
| name: Actions CI | |
| # This `name:` is used in the badge.svg rendering in the README.md. | |
| permissions: {} | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'exp' | |
| - 'exp/*' | |
| - 'exp-*' | |
| - 'exp_*' | |
| - 'wip' | |
| - 'wip/*' | |
| - 'wip-*' | |
| - 'wip_*' | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| checks: write | |
| statuses: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - id: setup-go | |
| name: Set up Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version: 'stable' | |
| check-latest: true | |
| - id: go-settings | |
| name: Export Go environment to Actions outputs | |
| run: | | |
| echo >> "$GITHUB_OUTPUT" "arch=$(go env GOARCH)" | |
| echo >> "$GITHUB_OUTPUT" "hostarch=$(go env GOHOSTARCH)" | |
| echo >> "$GITHUB_OUTPUT" "os=$(go env GOOS)" | |
| echo >> "$GITHUB_OUTPUT" "hostos=$(go env GOHOSTOS)" | |
| echo >> "$GITHUB_OUTPUT" "go-version=$(go env GOVERSION)" | |
| - id: go-dependencies | |
| name: Download all Go dependencies | |
| run: | | |
| go list all | |
| - name: Basic Go integrity checks | |
| # We don't use `gofmt -s` because it complains about some of the _generated_ blocks | |
| run: | | |
| t="$(gofmt -l .)" | |
| if [ ".$t" != "." ]; then printf 'gofmt would modify files:\n%s\n' "$t"; exit 1; fi | |
| go vet ./... | |
| t="$(go list -m -retracted -f '{{if .Retracted}}::error file=go.mod::{{.Path}} is retracted{{end}}' all)" | |
| if [ ".$t" != "." ]; then printf '%s\n' "$t"; exit 1; fi | |
| - name: Go build & test | |
| run: | | |
| go build ./... | |
| go test -v -coverprofile=${{ runner.temp }}/profile.cov -coverpkg ./... ./... | |
| # - name: Send coverage | |
| # uses: shogo82148/actions-goveralls@v1 | |
| # with: | |
| # path-to-profile: ${{ runner.temp }}/profile.cov | |
| # flag-name: ${{ steps.go-settings.outputs.go-version }} |