Skip to content

docs: add sphinx docs for the zixy-py project #110

docs: add sphinx docs for the zixy-py project

docs: add sphinx docs for the zixy-py project #110

Workflow file for this run

name: Unit tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch: {}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
# Pinned version for the uv package manager
UV_VERSION: "0.4.20"
UV_FROZEN: 1
RUSTFLAGS: "--cfg=ci_run"
CI: true # insta snapshots behave differently on ci
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
# The highest and lowest supported Python versions, used for testing
PYTHON_HIGHEST: "3.13"
PYTHON_LOWEST: "3.10"
LLVM_VERSION: "14.0"
LLVM_FEATURE_NAME: "14-0"
jobs:
check-rs:
name: Check Rust code 🦀
runs-on: ubuntu-latest
env:
# Fail on rust compiler warnings.
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check formatting
run: cargo fmt -- --check
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{ env.LLVM_VERSION }}
- name: Run clippy
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
- name: Build docs
run: cargo doc --no-deps --all-features --workspace
env:
RUSTDOCFLAGS: "-Dwarnings"
test-rs:
runs-on: ubuntu-latest
name: Tests (Rust stable, all features)
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.9
- id: toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "stable"
- name: Configure default rust toolchain
run: rustup override set ${{steps.toolchain.outputs.name}}
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{ env.LLVM_VERSION }}
- name: Build with all features
run: cargo test --verbose --workspace --all-features --no-run
- name: Tests with all features
run: cargo test --verbose --workspace --all-features
check-py:
runs-on: ubuntu-latest
name: Check Python code
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Python ${{ env.PYTHON_LOWEST }}
run: uv python install ${{ env.PYTHON_LOWEST }}
- name: Setup dependencies
run: uv sync --python ${{ env.PYTHON_LOWEST }}
- name: Ruff
working-directory: zixy-py
run: |
uv run ruff format --check
uv run ruff check
- name: MyPy
working-directory: zixy-py
run: |
uv run mypy zixy
tests-py:
runs-on: ubuntu-latest
name: Tests (Python, coverage)
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Python ${{ env.PYTHON_LOWEST }}
run: uv python install ${{ env.PYTHON_LOWEST }}
- name: Setup dependencies
run: uv sync --python ${{ env.PYTHON_LOWEST }}
- name: Run python tests with coverage instrumentation
run: uv run pytest --cov=./ --cov-report=xml
- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: ./coverage.txt
# - name: Upload python coverage to codecov.io
# if: github.event_name != 'merge_group'
# uses: codecov/codecov-action@v5
# with:
# files: ./coverage.xml
# # Ensures we only upload this file
# disable_search: true
# name: python
# flags: python
# fail_ci_if_error: true
# token: ${{ secrets.CODECOV_TOKEN }}