Skip to content

feat: add execution metrics support with ExecutionSummary #280

feat: add execution metrics support with ExecutionSummary

feat: add execution metrics support with ExecutionSummary #280

Workflow file for this run

# Runs unit tests.
name: Unit Tests
on:
pull_request:
merge_group:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: {}
jobs:
test:
name: Run unit tests and generate report
runs-on: ubuntu-latest
timeout-minutes: 60 # better fail-safe than the default 360 in github actions
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
with:
persist-credentials: false
- name: Cleanup space
uses: ./.github/actions/cleanup # zizmor: ignore[unpinned-uses]
- name: Install toolchains
uses: ./.github/actions/toolchains # zizmor: ignore[unpinned-uses]
- uses: dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4 # nightly
with:
components: llvm-tools-preview
toolchain: nightly-2024-07-27
- name: Install latest nextest release
uses: taiki-e/install-action@9903ab6feadaec33945de535fe9d181b91802a55 # v2
with:
tool: nextest@0.9.98
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@9903ab6feadaec33945de535fe9d181b91802a55 # v2
with:
tool: cargo-llvm-cov
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
with:
cache-on-failure: true
- name: Run tests with coverage
run: |
cargo llvm-cov --workspace --locked nextest --profile ci --lcov --output-path lcov.info
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2
if: always()
with:
paths: "target/nextest/ci/junit.xml"
- name: Publish Test Coverage
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
doc:
name: Run doc tests
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: 1
timeout-minutes: 60
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
with:
persist-credentials: false
- name: Cleanup space
uses: ./.github/actions/cleanup # zizmor: ignore[unpinned-uses]
- name: Install toolchains
uses: ./.github/actions/toolchains # zizmor: ignore[unpinned-uses]
- uses: dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4 # nightly
with:
toolchain: nightly-2024-07-27
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
with:
cache-on-failure: true
- name: Run doctests
run: cargo test --doc --workspace
unit-success:
name: Check that unit tests pass
runs-on: ubuntu-latest
if: always()
needs: [test, doc]
timeout-minutes: 60
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: ${{ toJSON(needs) }}