feat: Track code coverage #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
branches: | |
- "master" | |
env: | |
# Golang version to use across CI steps | |
GOLANG_VERSION: '1.20' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
event_file: | |
name: "Event File" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Event File | |
path: ${{ github.event_path }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/[email protected] | |
with: | |
go-version: ${{ env.GOLANG_VERSION }} | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Restore go build cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/go-build | |
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }} | |
- name: Download all Go modules | |
run: | | |
go mod download | |
- name: Generate code coverage artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage | |
path: coverage.out | |
- name: Upload code coverage information to codecov.io | |
uses: codecov/[email protected] | |
with: | |
file: coverage.out |