zombie-einstein pre-merge #19
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: pre-merge | |
run-name: ${{ github.actor }} pre-merge | |
on: [pull_request] | |
jobs: | |
rust_checks: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
container: rust:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Build Rust package | |
run: cargo build --workspace | |
- name: Rust tests | |
run: cargo test | |
- name: Rust formatting | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
run: cargo clippy -- -Dwarnings | |
- name: Random stepped example | |
run: cargo run --example random_agents | |
- name: Order book example | |
run: cargo run --example order_book | |
- name: Build docs 📚 | |
run: cargo doc --no-deps | |
maturin_build: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install hatch 🐣 | |
run: pip install hatch | |
- name: Python linting | |
run: hatch run dev:lint | |
- name: Maturin build | |
run: hatch run dev:build | |
- name: Upload wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python_build | |
path: target/wheels/bourse-*.whl | |
python_tests: | |
needs: maturin_build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
name: python_build | |
- name: Install package | |
run: pip install bourse-*-manylinux_2_34_x86_64.whl | |
- name: Install pytest | |
run: pip install pytest pytest-benchmark | |
- name: Run tests 🧪 | |
run: pytest -v tests | |
python_examples: | |
needs: maturin_build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
name: python_build | |
- name: Install package | |
run: pip install bourse-*-manylinux_2_34_x86_64.whl | |
- name: Run random agent example | |
run: python examples/random_trades.py | |
python_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install hatch 🐣 | |
run: pip install hatch | |
- name: Install bourse and build docs 📚 | |
run: hatch run docs:build | |
- name: Test doc examples | |
run: hatch run docs:test |