Feat/refactor #6
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: | |
types: [opened, synchronize, reopened] | |
permissions: read-all | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Clippy - Rust linter | |
- name: Install Rust toolchain | |
run: rustup toolchain install stable | |
- name: Run Clippy | |
run: rustup component add clippy && cargo clippy -- -D warnings | |
# Set up Python and create a virtual environment | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Create and activate virtual environment | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
# Install and run Ruff - Python linter | |
- name: Install Ruff | |
run: pip install ruff | |
- name: Run Ruff | |
run: ruff . | |
# Python unittests within the virtual environment | |
- name: Install dependencies for unittests | |
run: | | |
pip install maturin | |
maturin develop | |
- name: Run unittests | |
run: python -m unittest discover -s tests -p '*.py' | |
# Build and test steps for Rust | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose |