Skip to content

test

test #2036

Workflow file for this run

name: Test
on:
push:
branches:
- master
- release/**
- test-flaky-034
pull_request:
permissions:
contents: read
defaults:
run:
shell: bash
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Module Mode
runs-on: ${{ matrix.os }}-latest
env:
GO111MODULE: "on"
GOFLAGS: "-mod=readonly"
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go }}-
- name: Build
run: make build
- name: Vet
run: make vet
- name: Check go.mod Tidiness
run: make mod-tidy
if: ${{ matrix.go == '1.21' }}
- name: Test${{ matrix.race && ' (with race detection)' || '' }}
run: ${{ matrix.race && 'make test-race' || 'make test-coverage' }}
# Skip race detection tests on PRs except for the ubuntu+go1.23 combination
if: ${{ !matrix.race || github.event_name != 'pull_request' || (matrix.go == '1.23' && matrix.os == 'ubuntu') }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # [email protected]
with:
directory: .coverage
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ !matrix.race }}
timeout-minutes: 15
strategy:
matrix:
go: ["1.24", "1.23", "1.22"]
os: [ubuntu, windows, macos]
race: [false, true]
fail-fast: false