Merge branch 'actions'
This commit is contained in:
commit
b1d49624d4
1 changed files with 53 additions and 30 deletions
|
@ -6,7 +6,7 @@ name: CI
|
||||||
jobs:
|
jobs:
|
||||||
formatting:
|
formatting:
|
||||||
name: Formatting
|
name: Formatting
|
||||||
runs-on: docker
|
runs-on: ubuntu-22.04
|
||||||
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: docker
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -32,40 +32,63 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: docker
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout the code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
# TODO: Find some other method of managing this that doesn't require me to set stuff up myself
|
|
||||||
- name: Set up Python toolchain
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
cache: pip
|
|
||||||
- name: Set up Python environment
|
|
||||||
run: |
|
|
||||||
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
|
|
||||||
pip install -r requirements.txt
|
|
||||||
- name: Set up Rust
|
- name: Set up Rust
|
||||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||||
|
- name: Set up the Python toolchain
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.13"
|
||||||
|
- name: Set up the Python environment
|
||||||
|
# For most Python CI stuff this isn't needed, but maturin specifically doesn't like to function without a venv
|
||||||
|
run: |
|
||||||
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
- name: Build Rust code
|
- name: Build Rust code
|
||||||
run: |
|
run: |
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
maturin develop
|
maturin build
|
||||||
|
- 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
|
||||||
|
|
||||||
# TODO: Moving tests to another job feels like better form
|
python-test:
|
||||||
|
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
|
||||||
|
|
||||||
# FIXME: The runner's Python version is 3.9, which breaks one some of the type syntax found in the tests
|
rust-test:
|
||||||
# - name: Run Python tests
|
name: Rust tests
|
||||||
# run: |
|
runs-on: ubuntu-22.04
|
||||||
# source venv/bin/activate
|
steps:
|
||||||
# pytest tests/*.py
|
- name: Checkout the code
|
||||||
|
uses: actions/checkout@v4
|
||||||
# FIXME: Linking with `cc` fails on the runner because it can't find the python3.9 library
|
- name: Set up Rust
|
||||||
# - name: Run Rust tests
|
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||||
# run: |
|
- name: Set up the Python toolchain
|
||||||
# source venv/bin/activate
|
uses: actions/setup-python@v5
|
||||||
# cargo test
|
with:
|
||||||
|
python-version: "3.13"
|
||||||
|
- name: Run Rust tests
|
||||||
|
run: cargo test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue