From bd142478e9f04639eaf84a1aa27f5f8f6ef0afae Mon Sep 17 00:00:00 2001 From: SuperAuguste <19855629+SuperAuguste@users.noreply.github.com> Date: Fri, 21 Jul 2023 19:45:06 +0200 Subject: [PATCH] coverage: add coverage CI action --- .github/workflows/kcov.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/kcov.yml diff --git a/.github/workflows/kcov.yml b/.github/workflows/kcov.yml new file mode 100644 index 000000000..e749e9480 --- /dev/null +++ b/.github/workflows/kcov.yml @@ -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 + 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 +