Skip to content

Commit

Permalink
try a different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre committed Nov 16, 2024
1 parent f35dbfd commit 5418aa8
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Coverage

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
codecov:
name: Code coverage
runs-on: ${{ matrix.job.os }}
timeout-minutes: 90
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
strategy:
fail-fast: false
matrix:
job:
- { os: ubuntu-latest , features: unix, toolchain: nightly }
- { os: macos-latest , features: macos, toolchain: nightly }
# FIXME: Re-enable Code Coverage on windows, which currently fails due to "profiler_builtins". See #6686.
# - { os: windows-latest , features: windows, toolchain: nightly-x86_64-pc-windows-gnu }

env:
CARGO_INCREMENTAL: "0"

steps:
- uses: actions/checkout@v4

- name: Install Rust
run: rustup update stable

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Install Rust
run: rustup update stable

- name: llvm-cov show-env
run: cargo llvm-cov show-env --export-prefix

- name: Build bindingTester
run: source <(cargo llvm-cov show-env --export-prefix) && cargo build --features=${{ matrix.job.features }}

- name: Test main crate
run: source <(cargo llvm-cov show-env --export-prefix) && cargo test --features=${{ matrix.job.features }} -p uucore -p coreutils

- name: Generate code coverage
run: source <(cargo llvm-cov show-env --export-prefix) && cargo llvm-cov report --lcov --output-path lcov.info

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true

0 comments on commit 5418aa8

Please sign in to comment.