Fix build #60
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: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
# Cargo check. | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Run cargo check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all | |
# Cargo fmt and clippy | |
lints: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Run cargo clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all -- -D warnings -A deprecated | |
# Pytest | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, "3.10.12"] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Create and activate virtual environment | |
run: | | |
python -m venv .venv | |
echo ".venv/bin" >> $GITHUB_PATH | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install maturin | |
run: cargo install maturin | |
- name: Build and Install Python Package | |
run: | | |
source .venv/bin/activate | |
maturin develop --release | |
- name: Install pytest | |
run: | | |
source .venv/bin/activate | |
pip install pytest | |
- name: Run pytest | |
run: | | |
source .venv/bin/activate | |
pytest tests |