diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55ddd396..10e24d7f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,28 +16,26 @@ jobs: - uses: actions/checkout@v4 - name: Set default nightly run: rustup default nightly && rustup update + - name: Install cargo-tarpaulin + run: cargo install cargo-tarpaulin - name: Build run: cargo build --all --verbose - name: Run tests run: cargo test --tests --lib --verbose -- --show-output --nocapture - name: Run doctests run: cargo test --package rencfs --doc --verbose -- --show-output --nocapture - - name: kcov - run: | - wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && - tar xzf master.tar.gz && - cd kcov-master && - mkdir build && - cd build && - cmake .. && - make && - make install DESTDIR=../../kcov-build && - cd ../.. && - rm -rf kcov-master && - for file in target/debug/examplerust-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done && - bash <(curl -s https://codecov.io/bash) && - echo "Uploaded code coverage" - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} + - name: Run tests with coverage + run: cargo tarpaulin --out Xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + files: ./cobertura.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}