Poindexter/.github/workflows/ci.yml

57 lines
1.1 KiB
YAML

name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.22.x', '1.23.x' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Go env
run: go env
- name: Tidy check
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Test (race)
run: go test -race ./...
- name: Build examples
run: |
if [ -d examples ]; then
go build ./examples/...
fi
- name: Vulncheck
uses: golang/govulncheck-action@v1
with:
go-version-input: ${{ matrix.go-version }}
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m