From e0131a1bfa104e58e1624eae44d4567dcb4803e5 Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 08:48:23 -0500 Subject: [PATCH 1/3] Add the Python toolchain to Rust tests --- .forgejo/workflows/build.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 67af278..d85ca19 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -66,5 +66,9 @@ jobs: uses: actions/checkout@v4 - name: Set up Rust 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: Run Rust tests run: cargo test From b70b9a716ab2efcd41ac3655f613499dbbf6418d Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 08:51:35 -0500 Subject: [PATCH 2/3] Temporarily disable lints for brevity --- .forgejo/workflows/build.yaml | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index d85ca19..ab9ae08 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -4,31 +4,31 @@ on: [push] name: CI jobs: - formatting: - name: Formatting - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Rust - uses: https://github.com/dtolnay/rust-toolchain@stable - with: - components: rustfmt - - name: Check Rust formatting - run: cargo fmt --all -- --check + # formatting: + # name: Formatting + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # - name: Set up Rust + # uses: https://github.com/dtolnay/rust-toolchain@stable + # with: + # components: rustfmt + # - name: Check Rust formatting + # run: cargo fmt --all -- --check - clippy: - name: Clippy - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Rust - uses: https://github.com/dtolnay/rust-toolchain@stable - with: - components: clippy - - name: Run Clippy - run: "echo 'pretend i ran'" # cargo clippy -- -D warnings + # clippy: + # name: Clippy + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # - name: Set up Rust + # uses: https://github.com/dtolnay/rust-toolchain@stable + # with: + # components: clippy + # - name: Run Clippy + # run: cargo clippy -- -D warnings build: name: Build (and tests, for now) From b390cd81c78503e310a38ddfe245ed2340b9c1bd Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 09:03:44 -0500 Subject: [PATCH 3/3] Move Python tests into their own job --- .forgejo/workflows/build.yaml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index ab9ae08..613d446 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -42,7 +42,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.13" - cache: pip - 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: | @@ -52,14 +51,35 @@ jobs: - name: Build Rust code run: | source venv/bin/activate - maturin develop + maturin build + - name: Save built wheel + uses: forgejo/upload-artifact@v4 + with: + name: pyority_queue.whl + path: target/wheels/*.whl + compression-level: 0 + + 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 pyority_queue.whl - name: Run Python tests - run: | - source venv/bin/activate - pytest tests/*.py + run: pytest tests/*.py rust-test: - name: Rust test + name: Rust tests runs-on: ubuntu-22.04 steps: - name: Checkout the code