Skip to content

Commit 63f5221

Browse files
committed
Add Unit tests GitHub Actions workflow
The README advertised a Unit tests badge but no such workflow existed, and the test package was never run in CI. Runs build, vet, and 'make test' on pushes to main and on PRs.
1 parent 2af86fa commit 63f5221

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Unit test workflow.
2+
name: Unit tests
3+
4+
# Run unit tests and vet on pushes to main and on every pull request.
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
19+
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
20+
with:
21+
go-version-file: 'go.mod'
22+
cache: true
23+
- name: Build
24+
run: go build ./...
25+
- name: Vet
26+
run: go vet ./...
27+
- name: Unit tests
28+
run: make test

0 commit comments

Comments
 (0)