Skip to content

fix: Simplify benchmark CI job to avoid gh-pages requirement #157

fix: Simplify benchmark CI job to avoid gh-pages requirement

fix: Simplify benchmark CI job to avoid gh-pages requirement #157

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.23.x', '1.24.x'] # Include 1.23 as fallback
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
check-latest: true
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Build
run: go build -v ./...
- name: Test
run: go test -race -coverprofile=coverage.out -covermode=atomic -v ./...
- name: Upload coverage to Codecov
if: matrix.go-version == '1.24.x' # Only upload once
uses: codecov/codecov-action@v4
with:
file: ./coverage.out
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }} # Add token for better reliability
benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.x'
cache: true
check-latest: true
- name: Download dependencies
run: go mod download
- name: Run benchmarks
run: go test -bench=. -benchmem -benchtime=1s -run=^$$ ./...