Skip to content

⬆️ Update dependency @astrojs/starlight to v0.40.0 #28

⬆️ Update dependency @astrojs/starlight to v0.40.0

⬆️ Update dependency @astrojs/starlight to v0.40.0 #28

Workflow file for this run

---
name: Coverage
# yamllint disable-line rule:truthy
on:
push:
pull_request:
workflow_dispatch:
# Cancel superseded runs for the same ref to save CI minutes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Default to read-only; the job below opts into the one write scope it needs.
permissions:
contents: read
jobs:
coverage:
name: Rust coverage via pytest
runs-on: ubuntu-latest
permissions:
# Read the repository (checkout, cargo).
contents: read
# Publish the coverage report to GitHub code quality (required by
# actions/upload-code-coverage; the action cannot declare this itself).
# `code-quality` is a current GitHub permission that actionlint and zizmor
# do not recognize yet, hence the targeted suppressions for this scope.
code-quality: write # zizmor: ignore[excessive-permissions]
steps:
- name: ⤵️ Check out code (with config submodules)
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
submodules: true
- name: 🏗 Set up uv and Python
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
python-version: "3.13"
- name: 🏗 Set up Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # zizmor: ignore[superfluous-actions,stale-action-refs] stable; canonical pinned Rust toolchain installer
with:
components: llvm-tools-preview
- name: 🏗 Install dependencies
# numpy keeps the OPT_SERIALIZE_NUMPY path inside the coverage numbers.
run: uv sync --locked --no-install-project --no-default-groups --group build --group test --group numpy
- name: 🏗 Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: 🏗 Set up coverage environment
# show-env emits shell `export KEY='VALUE'` lines. Drop the `export `
# prefix and the surrounding single quotes so the raw values persist
# into later steps via $GITHUB_ENV (quotes would be taken literally
# there, corrupting RUSTFLAGS and the profile path).
run: >
cargo llvm-cov show-env --sh
| sed -E "s/^export //; s/^([^=]+)='(.*)'$/\1=\2/" >> "$GITHUB_ENV"
- name: 🧹 Clean coverage data
run: cargo llvm-cov clean --workspace
- name: 🚀 Run the Rust unit tests (instrumented)
run: cargo test --lib
- name: 🏗 Build and install yamlrocks (instrumented)
run: uv run --no-sync maturin develop
- name: 🚀 Run pytest to exercise the Rust core
run: uv run --no-sync python -m pytest
- name: 📊 Generate Cobertura coverage report
run: cargo llvm-cov report --cobertura --output-path coverage.xml
- name: 📤 Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: ./coverage.xml
- name: 📤 Upload coverage to GitHub
uses: actions/upload-code-coverage@abb5995db9e0199b0e2bb9dbd136fce4cb1ec4d3 # v1.3.0
with:
file: ./coverage.xml
label: code-coverage/pytest
# The GitHub-native code-coverage feature is opt-in per repository;
# until it is enabled the endpoint 404s, so do not fail CI on it.
fail-on-error: false
- name: ✅ Enforce coverage floor
run: cargo llvm-cov report --summary-only --fail-under-lines 90