Skip to content

coverage: add coverage CI action #39

coverage: add coverage CI action

coverage: add coverage CI action #39

Workflow file for this run

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: |
sudo apt-get update
sudo apt-get install kcov
- name: Run Tests with kcov
run: |
mkdir -p zig-out/kcov
zig build test -Dgenerate_coverage
tree zig-out
- uses: actions/checkout@master
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: zig-out/kcov/kcov-merged/coverage.json
fail_ci_if_error: true
verbose: true