Skip to content

Basic setup

Basic setup #6

Workflow file for this run

on:
push:
branches: [main]
pull_request:
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: |
passthrough/*.sum
- name: Install staticcheck
if: matrix.platform == 'ubunti-latest'
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
uses: actions/checkout@v3
- name: Fmt
if: matrix.platform != 'windows-latest'
run: "diff <(gofmt -d .) <(printf '')"
shell: bash
- name: Vet
run: go vet ./...
- name: Staticcheck
if: matrix.platform == 'ubunti-latest'
run: staticcheck ./...
- name: Test
# We have a moulti module setup, and this is the only way I could find to run tests in all modules.
run: find . -name go.mod -execdir go test -race ./... \; | grep -zqv FAIL