Go test with coverage
Go test with coverage Github action
Versions
Introduction
Run go test and send report to codecov
Example
name: Run tests and upload coverage
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, edited]
push:
permissions:
id-token: write
contents: read
jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Run tests and upload to coverage
uses: gouef/go-test-with-coverage-action@main
with:
go-version: 1.23.4
env:
GITHUB_TOKEN: $
CODECOV_TOKEN: $