Skip to content

Dev

Dev #23

Workflow file for this run

# 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:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Test and Coverage
run: go test -v -race -cover ./...
- name: Test CLI
run: go run go-cluster -h
- name: generate test coverage
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
# Configure action by specifying input parameters individually (option 2).
# If you are using config file (option 1) you shouldn't use these parameters, however
# specifing these action parameters will override appropriate config values.
profile: cover.out
local-prefix: github.com/phac-nml/go-cluster
threshold-file: 50
threshold-package: 50
threshold-total: 70
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
git-branch: badges