Skip to content

Commit fccc6cd

Browse files
committed
generate test coverage in CI
1 parent d3f7641 commit fccc6cd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: CI
22

3-
on: [pull_request, workflow_dispatch]
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
49

510
jobs:
611
main:
@@ -26,8 +31,15 @@ jobs:
2631
- name: Test
2732
run: make test
2833

34+
- name: Archive code coverage results
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: code-coverage
38+
path: coverage.out
39+
2940
config:
3041
name: Check GoReleaser config
42+
if: github.event_name == 'pull_request'
3143
runs-on: ubuntu-latest
3244
steps:
3345
- name: Checkout

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lint: lint-golangci-lint lint-yamllint
2525
# Test
2626
test:
2727
@echo ">> Running tests for the CLI application"
28-
@go test ./... -count=1
28+
@go test ./... -count=1 -coverprofile=coverage.out
2929

3030
# Test coverage
3131
coverage:

0 commit comments

Comments
 (0)