diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000000..17654940f5 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,35 @@ +name: coverage + +on: [push] + +env: + OCAML_VERSION: "4.14.0" + +jobs: + test: + name: coverage + runs-on: ubuntu-latest + container: + image: xd009642/tarpaulin:develop-nightly + options: --security-opt seccomp=unconfined + steps: + - name: Checkout repository + uses: actions/checkout@v4.1.1 + + - name: Setup OCaml ${{ env.OCAML_VERSION }} + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ env.OCAML_VERSION }} + # https://github.com/ocaml/setup-ocaml/issues/211#issuecomment-1058882386 + # disable-cache: true + + # Not activating all features because of Caml + - name: Generate code coverage + run: | + cargo +nightly tarpaulin --verbose --release --workspace --timeout 120 --out xml --engine=llvm + + # - name: Upload to codecov.io + # uses: codecov/codecov-action@v2 + # with: + # # token: ${{secrets.CODECOV_TOKEN}} # not required for public repos + # fail_ci_if_error: true diff --git a/.github/workflows/coverage.yml.disabled b/.github/workflows/coverage.yml.disabled deleted file mode 100644 index 837124ea24..0000000000 --- a/.github/workflows/coverage.yml.disabled +++ /dev/null @@ -1,44 +0,0 @@ -name: Coverage - -on: - workflow_dispatch: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - - coverage: - name: Coverage (+nightly) - # The large timeout is to accommodate nightly builds - timeout-minutes: 60 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.1 - with: - persist-credentials: false - - - uses: actions-rs/toolchain@v1.0.7 - with: - toolchain: nightly - override: true - profile: minimal - components: llvm-tools-preview - - - name: Install cargo-llvm-cov cargo command - run: cargo install cargo-llvm-cov - - - name: Setup OCaml (because of ocaml-gen) - run: sudo apt update && sudo apt install ocaml - - - name: Generate code coverage - env: - ZEBRA_SKIP_NETWORK_TESTS: 1 - CARGO_INCREMENTAL: 0 - run: cargo llvm-cov --lcov > lcov.info - - - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v2.0.3