rustframe/.github/workflows/run-unit-tests.yml
2025-05-03 23:17:47 +01:00

45 lines
1.3 KiB
YAML

name: run-unit-tests
on:
pull_request:
types: [review_requested, ready_for_review, synchronize, opened, reopened]
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-unit-tests:
if: github.event.pull_request.draft == false
name: run-unit-tests
# runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu-latest]
env:
CARGO_TERM_COLOR: always
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: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Run doc-tests
run: cargo test --doc --all-features --workspace --release
- name: Test docs generation
run: cargo doc --no-deps --release
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}