Skip to content

ci: test on ubuntu-24.04 and macos-15 runners #265

ci: test on ubuntu-24.04 and macos-15 runners

ci: test on ubuntu-24.04 and macos-15 runners #265

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
strategy:
matrix:
# Oldest supported version is 1.18, plus the latest two releases.
go-version: ['1.18', '1.22', '1.23']
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-13, macos-14, macos-15, windows-2019, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version: ${{ matrix.go-version }}
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Check formatting
if: ${{ matrix.go-version == '1.23' && matrix.os == 'ubuntu-latest' }}
run: diff -u <(echo -n) <(gofmt -d .)
- name: Check Go modules
if: ${{ matrix.go-version == '1.23' && matrix.os == 'ubuntu-latest' }}
run: |
go mod tidy
git diff --exit-code
- name: Build (cross-compile)
if: matrix.os == 'ubuntu-latest'
run: |
GOOS=darwin go build ./...
GOOS=dragonfly go build ./...
GOOS=freebsd go build ./...
GOOS=linux go build ./...
GOOS=netbsd go build ./...
GOOS=openbsd go build ./...
GOOS=solaris go build ./...
GOOS=windows go build ./...
- name: Test (native)
run: go test -v ./...