check #207
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: check | |
on: | |
push: | |
branches: [main, feature/*] | |
tags: | |
- '*' | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * SUN' | |
env: | |
PYTHON_LATEST: "3.12" | |
jobs: | |
pre-commit: | |
name: "pre-commit" | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@v4" | |
with: | |
submodules: 'recursive' # Fetch Git submodules recursively | |
# Initialize and update submodules (optional, if submodules were not initialized during checkout) | |
- name: Update submodules | |
run: git submodule update --init --recursive | |
- uses: "actions/setup-python@v4" | |
with: | |
python-version: ${{env.PYTHON_LATEST}} | |
- uses: "dtolnay/rust-toolchain@stable" | |
- uses: "pre-commit/[email protected]" | |
clippy: | |
runs-on: ubuntu-latest | |
name: ${{ matrix.toolchain }} / clippy | |
needs: pre-commit | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable, beta, nightly] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' # Fetch Git submodules recursively | |
# Initialize and update submodules (optional, if submodules were not initialized during checkout) | |
- name: Update submodules | |
run: git submodule update --init --recursive | |
- uses: "dtolnay/rust-toolchain@master" | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: clippy | |
- name: "clippy ${{ matrix.toolchain }}" | |
run: cargo clippy | |
cargo-test: | |
name: cargo test | |
runs-on: ubuntu-latest | |
needs: clippy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' # Fetch Git submodules recursively | |
# Initialize and update submodules (optional, if submodules were not initialized during checkout) | |
- name: Update submodules | |
run: git submodule update --init --recursive | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo test --no-default-features | |
python-test: | |
name: "Test Python ${{ matrix.python-version }}" | |
runs-on: "ubuntu-latest" | |
needs: clippy | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: "actions/checkout@v4" | |
with: | |
submodules: 'recursive' # Fetch Git submodules recursively | |
# Initialize and update submodules (optional, if submodules were not initialized during checkout) | |
- name: Update submodules | |
run: git submodule update --init --recursive | |
- uses: "actions/setup-python@v4" | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- uses: "dtolnay/rust-toolchain@stable" | |
- name: "Install dependencies" | |
run: | | |
set -xe | |
python -VV | |
python -m site | |
python -m pip install --upgrade pip | |
python -m pip install ".[tests]" | |
- name: "Run pytest for ${{ matrix.python-version }}" | |
run: "pytest" | |
msrv: | |
runs-on: "ubuntu-latest" | |
needs: ["cargo-test", "python-test"] | |
strategy: | |
matrix: | |
msrv: ["1.76.0", "1.77.0"] | |
name: "ubuntu / ${{ matrix.msrv }}" | |
steps: | |
- uses: "actions/checkout@v4" | |
with: | |
submodules: 'recursive' # Fetch Git submodules recursively | |
# Initialize and update submodules (optional, if submodules were not initialized during checkout) | |
- name: Update submodules | |
run: git submodule update --init --recursive | |
- uses: "dtolnay/rust-toolchain@master" | |
with: | |
toolchain: "${{ matrix.msrv }}" | |
- name: "cargo +${{ matrix.msrv }} check" | |
run: "cargo check" |