From 8d162d32c34d9a7aae412c6b09ae47ad3ade4a38 Mon Sep 17 00:00:00 2001 From: Auguste Rame <19855629+SuperAuguste@users.noreply.github.com> Date: Tue, 21 Nov 2023 12:36:43 -0500 Subject: [PATCH] coverage: add coverage CI action (#1343) --- .github/workflows/coverage.yml | 41 ++++++++++++++++++++++++++++++++++ codecov.yml | 1 + 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/coverage.yml create mode 100644 codecov.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..08b68e85f --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,41 @@ +name: Code Coverage + +on: [push, pull_request] + +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 + + - name: Upload to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: zig-out/kcov/kcov-merged + fail_ci_if_error: true + verbose: true + diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..d49e0ad85 --- /dev/null +++ b/codecov.yml @@ -0,0 +1 @@ +comment: