Skip to content

Fix coverage collection in CI #4

Fix coverage collection in CI

Fix coverage collection in CI #4

Workflow file for this run

name: Test
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Install dependencies
run: go mod download
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -race ./...
- name: Test with coverage
if: matrix.os == 'ubuntu-latest'
run: go test -race -coverprofile=coverage.out $(go list ./... | grep -v /cmd/)
- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
files: coverage.out
fail_ci_if_error: false
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Run go vet
run: go vet ./...
- name: Run go fmt check
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Files not formatted:"
gofmt -l .
exit 1
fi