gha: set default permissions, and add golangci-lint #144
Workflow file for this run
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: Test | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: ${{ matrix.os }} / ${{ matrix.go-version || 'minimum' }} | |
| strategy: | |
| matrix: | |
| go-version: | |
| - "" # leave empty to use go-version-file (use go.mod); see https://github.com/actions/setup-go/issues/450#issuecomment-3620402646 | |
| - oldstable | |
| - stable | |
| platform: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.platform }} | |
| env: | |
| GOTOOLCHAIN: local | |
| steps: | |
| - name: Install Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| go-version-file: go.mod # used when go-version is empty. | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Test | |
| run: go test -v ./... | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.11 | |
| - name: Test Blake3 | |
| run: go test -v ./... | |
| working-directory: blake3 | |
| - name: Lint Blake3 | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.11 |