Compare commits

..

No commits in common. "b1d49624d496230b33072ff62b875c64d31615e5" and "2d4a6aedfe1f5f85a59639d101b3713e4da4a591" have entirely different histories.

View file

@ -6,7 +6,7 @@ name: CI
jobs: jobs:
formatting: formatting:
name: Formatting name: Formatting
runs-on: ubuntu-22.04 runs-on: docker
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -19,7 +19,7 @@ jobs:
clippy: clippy:
name: Clippy name: Clippy
runs-on: ubuntu-22.04 runs-on: docker
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -32,63 +32,40 @@ jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-22.04 runs-on: docker
steps: steps:
- name: Checkout the code - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Rust # TODO: Find some other method of managing this that doesn't require me to set stuff up myself
uses: https://github.com/dtolnay/rust-toolchain@stable - name: Set up Python toolchain
- name: Set up the Python toolchain
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.13" cache: pip
- name: Set up the Python environment - name: Set up Python environment
# For most Python CI stuff this isn't needed, but maturin specifically doesn't like to function without a venv
run: | run: |
python3 -m venv venv curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
python3 -m pip install virtualenv
python3 -m virtualenv venv
source venv/bin/activate source venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
- name: Set up Rust
uses: https://github.com/dtolnay/rust-toolchain@stable
- name: Build Rust code - name: Build Rust code
run: | run: |
source venv/bin/activate source venv/bin/activate
maturin build maturin develop
- name: Save built wheel
uses: forgejo/upload-artifact@v4
with:
name: wheels
path: target/wheels/*.whl # Should only match the one target built
compression-level: 0
python-test: # TODO: Moving tests to another job feels like better form
name: Python tests
runs-on: ubuntu-22.04
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Set up the Python toolchain
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Set up the Python environment
run: pip install -r requirements.txt
- name: Retrieve built wheel
uses: forgejo/download-artifact@v4
- name: Install built wheel
run: pip install wheels/*.whl # Should only match the one target built
- name: Run Python tests
run: pytest tests/*.py
rust-test: # FIXME: The runner's Python version is 3.9, which breaks one some of the type syntax found in the tests
name: Rust tests # - name: Run Python tests
runs-on: ubuntu-22.04 # run: |
steps: # source venv/bin/activate
- name: Checkout the code # pytest tests/*.py
uses: actions/checkout@v4
- name: Set up Rust # FIXME: Linking with `cc` fails on the runner because it can't find the python3.9 library
uses: https://github.com/dtolnay/rust-toolchain@stable # - name: Run Rust tests
- name: Set up the Python toolchain # run: |
uses: actions/setup-python@v5 # source venv/bin/activate
with: # cargo test
python-version: "3.13"
- name: Run Rust tests
run: cargo test