Skip to content

Test against Go 1.24 through 1.26 #1003

Test against Go 1.24 through 1.26

Test against Go 1.24 through 1.26 #1003

Workflow file for this run

name: Test
on:
push:
pull_request:
permissions:
contents: read
jobs:
unit:
name: Unit (Go ${{ matrix.go-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ["1.24", "1.25", "1.26"]
env:
GOFLAGS: -mod=vendor
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Verify modules
run: go mod verify
- name: Vet
run: go vet -v ./...
- name: Unit tests
run: go test -v -timeout 2m -failfast ./...
race:
name: Race detector
runs-on: ubuntu-latest
env:
GOFLAGS: -mod=vendor
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache: true
- name: Race tests
run: go test -race -v -timeout 2m -failfast ./...
integration:
name: Hermetic integration tests
runs-on: ubuntu-latest
env:
GOFLAGS: -mod=vendor
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache: true
- name: Integration tests
run: go test -race -v -timeout 2m -failfast -tags=integration ./cmd/...
coverage:
name: Coverage
runs-on: ubuntu-latest
env:
GOFLAGS: -mod=vendor
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache: true
- name: Generate coverage
run: go test -v -timeout 2m -failfast -covermode atomic -coverprofile=.covprofile ./...
- name: Install goveralls
env:
GOFLAGS: ""
run: go install github.com/mattn/goveralls@v0.0.12
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=.covprofile -service=github
vendor:
name: Verify vendored dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache: true
- name: Check vendor tree
run: |
go mod vendor
git diff --exit-code -- go.mod go.sum vendor/