Fix CI workflow #6
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: CI | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
push: | |
branches: | |
- 'main' | |
jobs: | |
unit_tests: | |
name: "Unit tests" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.22 | |
- name: Test | |
run: go test -cover -coverprofile=coverage.txt -mod=readonly ./... | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage | |
path: coverage.txt | |
code_coverage: | |
name: "Code coverage report" | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
needs: unit_tests | |
steps: | |
# Normally,users of the action don't have to checkout the source code. | |
# We need this here however because we are using a local action.yml. | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
coverage-artifact-name: "code-coverage" | |
coverage-file-name: "coverage.txt" |