ci: install libasound2-dev so cmd/say builds on Linux runners #6
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: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-test-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install ALSA headers (required to build cmd/say on Linux) | |
| run: sudo apt-get update && sudo apt-get install -y libasound2-dev | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.26.0" | |
| check-latest: false | |
| - name: Verify gofmt | |
| run: | | |
| unformatted="$(gofmt -l .)" | |
| if [ -n "$unformatted" ]; then | |
| echo "The following files are not gofmt-formatted:" | |
| echo "$unformatted" | |
| exit 1 | |
| fi | |
| - name: Verify goimports | |
| run: | | |
| go install golang.org/x/tools/cmd/goimports@latest | |
| unformatted="$(goimports -l .)" | |
| if [ -n "$unformatted" ]; then | |
| echo "The following files are not goimports-formatted:" | |
| echo "$unformatted" | |
| exit 1 | |
| fi | |
| - name: go vet | |
| run: go vet ./... | |
| - name: staticcheck | |
| run: | | |
| go install honnef.co/go/tools/cmd/staticcheck@latest | |
| staticcheck ./... | |
| - name: govulncheck | |
| run: | | |
| go install golang.org/x/vuln/cmd/govulncheck@latest | |
| govulncheck ./... | |
| - name: go build | |
| run: go build ./... | |
| - name: go test (race) | |
| run: go test -race ./... | |
| - name: Verify go mod tidy | |
| run: | | |
| go mod tidy | |
| git diff --exit-code go.mod go.sum |