Skip to content

Merge pull request #34 from jferrl/dependabot/go_modules/golang.org/x… #108

Merge pull request #34 from jferrl/dependabot/go_modules/golang.org/x…

Merge pull request #34 from jferrl/dependabot/go_modules/golang.org/x… #108

Workflow file for this run

name: tests
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
GO111MODULE: on
permissions:
contents: read
jobs:
test:
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
contents: read # for actions/checkout to fetch code
strategy:
matrix:
go-version: [1.25.x]
platform: [ubuntu-latest]
include:
# only update test coverage stats with the most recent go version on linux
- go-version: 1.25.x
platform: ubuntu-latest
update-coverage: true
runs-on: ${{ matrix.platform }}
steps:
- name: Cancel previous
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa #0.12.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: Cache go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
${{ runner.os }}-go-
- name: Run go test
run: go test ./... -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
if: ${{ matrix.update-coverage }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}