Skip to content

CI

CI #162

Workflow file for this run

name: CI
on:
push:
pull_request:
schedule:
- cron: '0 8 * * 6'
jobs:
test:
name: "Test: Go ${{ matrix.go }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
go:
- ~1.18
- ~1.19
- ^1.20
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Test
run: go test -v ./...
fmt:
name: Gofmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- name: Check gofmt
run: test -z $(gofmt -l .)
cover:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- name: Test with Coverage
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
- uses: codecov/codecov-action@v3
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ^1.20
- name: Install dependencies
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Vet
run: go vet ./...
- name: Staticcheck
run: staticcheck -f stylish ./...