Skip to content

Commit

Permalink
Wire up code coverage (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton authored Dec 15, 2023
1 parent e6d0759 commit 2a163b7
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
jobs:
ci-pass:
name: CI is green
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- test
- wasm
Expand All @@ -25,14 +25,14 @@ jobs:
test:
name: ${{ matrix.os }} / ${{matrix.target || 'default' }}

runs-on: ${{ matrix.os || 'ubuntu-latest' }}
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}

strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
- ubuntu-22.04
- macOS-12
- windows-2022

steps:
- name: Checkout
Expand All @@ -49,10 +49,38 @@ jobs:
- name: Test
run: cargo test --all-features

coverage:
name: Coverage
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install rust
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # stable
with:
toolchain: stable
components: llvm-tools

- name: Cache cargo registry
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1

- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --version 0.5.38

- name: Generate coverage
run: cargo llvm-cov --all-features --lcov --output-path lcov.info --ignore-filename-regex "crates/bitwarden-api-"

- name: Upload to codecov.io
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

wasm:
name: WASM

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down

0 comments on commit 2a163b7

Please sign in to comment.