add OSes to workflow matrix for Python and Rust tests #318
Workflow file for this run
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python package | |
on: | |
push: | |
branches: main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["macos-latest", "ubuntu-latest", "windows-latest"] | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Setup LLVM coverage environment | |
run: | | |
cargo llvm-cov show-env --export-prefix > llvm-cov-env.sh | |
echo "source $(pwd)/llvm-cov-env.sh" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
.venv/bin/python -m pip install --upgrade pip | |
.venv/bin/pip install -r requirements.txt | |
.venv/bin/pip install pytest-cov | |
- name: Install Django Rusty Templates | |
run: | | |
source llvm-cov-env.sh | |
.venv/bin/maturin develop | |
- name: Lint test files | |
run: | | |
.venv/bin/ruff check | |
- name: Test with pytest | |
run: | | |
source llvm-cov-env.sh | |
.venv/bin/pytest --cov --cov-report=xml | |
- name: Get rust coverage report | |
run: | | |
source llvm-cov-env.sh | |
cargo llvm-cov report --codecov --output-path codecov.json | |
- name: Upload to codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
files: coverage.xml, codecov.json | |
fail_ci_if_error: true | |