cast/.github/workflows/test.yml

40 lines
1023 B
YAML
Raw Normal View History

on:
push:
branches: [main]
pull_request:
name: Test
permissions:
contents: read
jobs:
test:
strategy:
matrix:
2024-08-06 21:48:55 +03:00
go-version: [1.20.x, 1.21.x, 1.22.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
2024-08-06 21:48:55 +03:00
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
shell: bash
- name: Update PATH
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- name: Checkout code
2024-08-06 21:48:55 +03:00
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fmt
if: matrix.platform != 'windows-latest' # :(
run: "diff <(gofmt -d .) <(printf '')"
shell: bash
- name: Vet
run: go vet ./...
- name: Staticcheck
run: staticcheck ./...
- name: Test
run: go test -race ./...