Skip to content

Add Github Actions to lint, test and produce code coverage #21

Add Github Actions to lint, test and produce code coverage

Add Github Actions to lint, test and produce code coverage #21

Workflow file for this run

name: test
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@main
- name: setup
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install dependencies
run: make common-deps
- name: run tests
run: make test-coverage
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: "**/cover.out"
- name: report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: report
path: test/*.xml
reporter: java-junit
coverage:
name: code coverage
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
runs-on: ubuntu-latest
needs: test # Depends on the artifact uploaded by the "test" job
steps:
- uses: fgrosse/go-coverage-report@v1.0.1
with:
coverage-file-name: "cover.out"
continue-on-error: true