Add coverage + codecov #124
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
mise-env: ['oldstable', 'stable'] | |
env: | |
MISE_ENV: ${{ matrix.mise-env }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jdx/mise-action@v2 | |
with: | |
cache_key_prefix: mise-v0-${{ matrix.mise-env }} | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
- name: Verify Go version | |
run: go version | |
- name: Build | |
run: mise run build | |
- name: Test | |
run: mise run test | |
- name: Verify golden files | |
if: env.MISE_ENV == 'stable' | |
run: make diff-testdata | |
## Generate coverage for CodeCov | |
- name: Generate coverage | |
run: mise run cover | |
- name: Upload to CodeCov | |
uses: codecov/codecov-action@v5 | |
with: | |
files: ./cover.out | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
env: | |
MISE_ENV: stable | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jdx/mise-action@v2 | |
with: | |
cache_key_prefix: mise-v0-stable | |
- name: lint | |
run: mise run lint |