Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,79 +35,87 @@
- uses: Swatinem/rust-cache@v2

- uses: actions/setup-python@v5
with:
python-version: '3.14'

- run: cargo test --workspace --all-features --doc
- run: cargo doc --workspace --all-features --document-private-items --no-deps

test:
strategy:
matrix:
version: ['3.10', '3.11', '3.12', '3.13', '3.14']
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: rustup toolchain install stable --profile minimal --component llvm-tools-preview --no-self-update
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}

- uses: astral-sh/setup-uv@v3
- run: uv sync --all-extras --dev

- run: cargo llvm-cov nextest --lcov --output-path core.lcov --workspace --all-features --all-targets
- run: mv target/nextest/default/core-test-results.xml .

- name: Run Python tests
run: |
source .venv/bin/activate

# Clear prior profile data
cargo llvm-cov clean --workspace

# Set env vars so maturin will build our Rust code with coverage instrumentation
source <(cargo llvm-cov show-env --export-prefix)
maturin develop --uv

# Run Python tests. Any Rust code exercised by these tests will emit coverage data
pytest --cov --junitxml=python-test-results.xml

# Turn the Rust coverage data into an lcov file
cargo llvm-cov --no-run --lcov --output-path bindings.lcov
cargo llvm-cov report --lcov --output-path bindings.lcov

- name: Upload coverage data to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
files: ./core.lcov,./bindings.lcov,./.coverage
token: ${{ secrets.CODECOV_ORG_TOKEN }}
url: ${{ secrets.CODECOV_URL }}
disable_search: true
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
files: ./core-test-results.xml,./python-test-results.xml
token: ${{ secrets.CODECOV_ORG_TOKEN }}
url: ${{ secrets.CODECOV_URL }}
disable_search: true
verbose: true

- name: Upload coverage data to Codecov (Staging)
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
files: ./core.lcov,./bindings.lcov,./.coverage
token: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }}
url: ${{ secrets.CODECOV_STAGING_API_URL }}
disable_search: true
verbose: true
- name: Upload test results to Codecov (Staging)
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
files: ./core-test-results.xml,./python-test-results.xml
token: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }}
url: ${{ secrets.CODECOV_STAGING_API_URL }}
disable_search: true
verbose: true

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Loading
Loading