Skip to content

Commit 2755f98

Browse files
authored
Create coverage.yml
1 parent dead82e commit 2755f98

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Code Coverage
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
paths:
6+
- .github/workflows/*
7+
- src/**
8+
- build.zig
9+
- build.zig.zon
10+
jobs:
11+
coverage:
12+
if: github.repository_owner == 'zigtools'
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: ⬇️ Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: (Z) Install Zig
20+
uses: goto-bus-stop/setup-zig@v2
21+
with:
22+
version: master
23+
24+
- run: zig env
25+
26+
- name: Install kcov
27+
run: |
28+
wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz
29+
sudo tar xf kcov-amd64.tar.gz -C /
30+
31+
- name: Run Tests with kcov
32+
run: |
33+
kcov --version
34+
zig build test -Dcoverage --summary all
35+
36+
- name: Upload to Codecov
37+
uses: codecov/codecov-action@v5
38+
with:
39+
directory: zig-out/coverage/kcov-merged
40+
fail_ci_if_error: true
41+
verbose: true

0 commit comments

Comments
 (0)