Add MSRV #69
Workflow file for this run
This file contains 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 | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12.1" | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install pre-commit | |
- name: Lint | |
run: pre-commit run --all-files --show-diff-on-failure | |
test-rust: | |
name: Test Rust source | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
rust-toolchain: | |
- stable | |
- nightly | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: hecrj/setup-rust-action@v2 | |
with: | |
rust-version: ${{ matrix.rust-toolchain }} | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ matrix.rust-toolchain }} | |
- name: Run | |
run: cargo test -p rspolib | |
test-python: | |
name: Test Python bindings | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- 3.8 | |
- 3.9 | |
- "3.10" | |
- "3.11" | |
- "3.12.1" | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/python/dev-requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
cd python | |
python -m pip install --upgrade pip | |
pip install -r dev-requirements.txt | |
pip install . | |
- name: Test | |
run: python -m pytest -svv | |
linux-py-wheels: | |
name: Build Linux Python wheels | |
runs-on: ubuntu-latest | |
needs: [test-rust, test-python] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: PyO3/maturin-action@v1 | |
with: | |
manylinux: auto | |
command: build | |
args: --release --sdist -o dist --find-interpreter | |
working-directory: python | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: python/dist | |
windows-py-wheels: | |
name: Build Windows Python wheels | |
needs: [test-rust, test-python] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: PyO3/maturin-action@v1 | |
with: | |
command: build | |
args: --release -o dist --find-interpreter | |
working-directory: python | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: python/dist | |
macos-py-wheels: | |
name: Build MacOS Python wheels | |
needs: [test-rust, test-python] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: PyO3/maturin-action@v1 | |
with: | |
command: build | |
args: --release -o dist --universal2 --find-interpreter | |
working-directory: python | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels | |
path: python/dist | |
test-release-rust-crate: | |
name: Test Rust crate release | |
needs: test-rust | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: hecrj/setup-rust-action@v2 | |
with: | |
rust-version: stable | |
- name: Publish | |
run: | | |
cd rust | |
cargo login ${{ secrets.CRATES_TOKEN }} | |
cargo publish -v --dry-run | |
release-rust-crate: | |
name: Release Rust crate | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: test-release-rust-crate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: hecrj/setup-rust-action@v2 | |
with: | |
rust-version: stable | |
- name: Publish | |
run: | | |
cd rust | |
cargo login ${{ secrets.CRATES_TOKEN }} | |
cargo publish -v | |
release-py-wheels: | |
name: Release Python wheels | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- macos-py-wheels | |
- windows-py-wheels | |
- linux-py-wheels | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * |