Skip to content

Commit 18c842f

Browse files
committed
Add GitHub Actions workflow for running tests and uploading coverage
1 parent 917391e commit 18c842f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/test.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Run tests and upload coverage
2+
3+
on:
4+
push
5+
6+
jobs:
7+
test:
8+
name: Run tests and collect coverage
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
19+
- name: Install dependencies
20+
run: go mod download
21+
22+
- name: Run tests
23+
run: go test -timeout 30s -coverprofile=coverage.txt
24+
25+
- name: Upload results to Codecov
26+
uses: codecov/codecov-action@v4
27+
with:
28+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)