name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
test:
name: cargo test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Test (locked)
run: cargo test --locked --all-targets
- name: Clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Docs
run: cargo doc --locked --no-deps
python:
name: maturin develop (ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install maturin
run: pip install maturin
- name: Build extension
working-directory: python
run: maturin build --release --features python --out /tmp/wheels
- name: Install wheel and smoke import
run: |
pip install /tmp/wheels/*.whl
python -c "import readcon_db; print(readcon_db.__file__)"