Skip to content

added coverage test on github action #29

added coverage test on github action

added coverage test on github action #29

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:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
# Install all the dependencies
- name: Install dependencies
run: |
go version
go install honnef.co/go/tools/cmd/staticcheck@latest
go install golang.org/x/lint/golint@latest
go install github.com/kisielk/errcheck@latest
# Run lints on the code
- name: Run lints
run: |
go vet ./...
golint ./...
staticcheck ./...
errcheck ./...
# Run tests on the code
- name: Run tests
run: go test ./... -v
- name: Update coverage report
uses: ncruces/go-coverage-report@v0
with:
report: 'true'
chart: 'true'
amend: 'true'
reuse-go: 'true'
if: |
matrix.os == 'ubuntu-latest' &&
github.event_name == 'push'
continue-on-error: true