build(deps): bump pyo3 crate versions #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'CI: Rust' | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- '**.rs' | |
- Cargo.toml | |
- Cargo.toml | |
- rustfmt.toml | |
push: | |
branches: [main] | |
paths: | |
- '**.rs' | |
- Cargo.toml | |
- Cargo.toml | |
- rustfmt.toml | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CLICOLOR: 1 | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
jobs: | |
ci: | |
name: CI | |
needs: [fmt, check, docs, test, coverage] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Failed | |
run: exit 1 | |
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') | |
fmt: | |
name: Check formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
check: | |
name: Cargo check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check | |
run: cargo check | |
docs: | |
name: Check documentation | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run documentation | |
run: cargo doc --workspace --no-deps --document-private-items | |
test: | |
name: Test on ${{ matrix.os }} with Rust ${{ matrix.toolchain }} | |
strategy: | |
matrix: | |
build: [nightly, linux, windows, mac] | |
include: | |
- build: nightly | |
os: ubuntu-latest | |
toolchain: nightly | |
- build: linux | |
os: ubuntu-latest | |
toolchain: stable | |
- build: windows | |
os: windows-latest | |
toolchain: stable | |
- build: mac | |
os: macos-latest | |
toolchain: stable | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.rust != 'stable' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build | |
- name: Test | |
run: cargo test | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
components: llvm-tools-preview | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install llvm-cov | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-llvm-cov | |
- name: Generate coverage | |
run: cargo llvm-cov --doctests | |
- name: Determine if CODECOV_TOKEN is available | |
id: has_codecov | |
run: echo 'result=${{ secrets.CODECOV_TOKEN }}' >> $GITHUB_OUTPUT | |
- name: Generate coverage file | |
run: cargo llvm-cov --doctests --no-run --lcov --output-path lcov.info | |
if: steps.has_codecov.outputs.result != 0 | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v5 | |
with: | |
files: lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
fail_ci_if_error: false | |
if: steps.has_codecov.outputs.result != 0 |