Skip to content

ci: update actions to current versions, test against "go.mod", "oldstable", "stable #215

ci: update actions to current versions, test against "go.mod", "oldstable", "stable

ci: update actions to current versions, test against "go.mod", "oldstable", "stable #215

Workflow file for this run

name: CI
# Default to 'contents: read', which grants actions to read commits.
#
# If any permission is set, any permission not included in the list is
# implicitly set to "none".
#
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
pull_request:
jobs:
linux:
name: Test ${{ matrix.platform }} (${{ matrix.go || 'oldest' }})
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
go:
- "" # do not specify go-version to fall back on go-version-file (use go.mod); see https://github.com/actions/setup-go/issues/450#issuecomment-3620402646
- "oldstable"
- "stable"
platform: [ubuntu-24.04]
runs-on: ${{ matrix.platform }}
steps:
- name: Setup IPv6
run: sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 net.ipv6.conf.default.disable_ipv6=0 net.ipv6.conf.all.disable_ipv6=0
- name: Checkout code
uses: actions/checkout@v6
- name: Install Go ${{ matrix.go }}
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
go-version-file: "go.mod" # used when go-version is not specified.
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
args: --timeout=5m
- name: Build for ${{ matrix.platform }}
run: go build ./...
- name: Test
run: go test -exec sudo -v ./...
other:
name: Test ${{ matrix.platform }} (${{ matrix.go || 'oldest' }})
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
go:
- "" # do not specify go-version to fall back on go-version-file (use go.mod); see https://github.com/actions/setup-go/issues/450#issuecomment-3620402646
- "oldstable"
- "stable"
platform: [windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Go ${{ matrix.go }}
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
go-version-file: "go.mod" # used when go-version is not specified.
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
args: --timeout=5m
- name: Build for ${{ matrix.platform }}
run: go build ./...
- name: Test
run: go test -v ./...