Skip to content

Commit

Permalink
coverage: add coverage CI action
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperAuguste committed Nov 21, 2023
1 parent 6b05cb6 commit 8b285d3
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/kcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Code Coverage

on:
pull_request:
types: [opened, synchronize]

permissions:
pull-requests: write

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- uses: goto-bus-stop/setup-zig@v2
with:
version: master

- run: zig version
- run: zig env

- name: Build
run: zig build

- name: Install kcov
run: |
wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz
sudo tar xf kcov-amd64.tar.gz -C /
- name: Run Tests with kcov
run: |
kcov --version
zig build test -Dgenerate_coverage
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: zig-out/kcov/kcov-merged
fail_ci_if_error: true
verbose: true

1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment:

0 comments on commit 8b285d3

Please sign in to comment.