Skip to content

Add test coverage

Add test coverage #21

Workflow file for this run

name: Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
run-tests:
name: "Run Go tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'
- name: Display Go version
run: go version
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: '8.0'
- name: Run Test
run: |
go test -v ./... -covermode=count -coverprofile=coverage.out
go tool cover -func=coverage.out -o=coverage.out
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage.out