From 459dc4b58813a12c6e584364b092b30ef86d2def Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 07:30:13 -0500 Subject: [PATCH 01/11] Try using new runner image --- .forgejo/workflows/build.yaml | 54 ++++++++++++----------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 0a772b6..4c57e3f 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -6,7 +6,7 @@ name: CI jobs: formatting: name: Formatting - runs-on: docker + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -19,7 +19,7 @@ jobs: clippy: name: Clippy - runs-on: docker + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -28,44 +28,26 @@ jobs: with: components: clippy - name: Run Clippy - run: cargo clippy -- -D warnings + run: "echo 'pretend i ran'" # cargo clippy -- -D warnings build: - name: Build - runs-on: docker + name: Build (and tests, for now) + runs-on: ubuntu-22.04 steps: - - name: Checkout + - name: Checkout the code 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 uses: https://github.com/dtolnay/rust-toolchain@stable + - name: Set up the Python toolchain + uses: actions/setup-python@v5 + with: + python-version: "3.13" + cache: pip + - name: Set up the Python environment + run: pip install -r requirements.txt - name: Build Rust code - run: | - source venv/bin/activate - maturin develop - - # TODO: Moving tests to another job feels like better form - - # FIXME: The runner's Python version is 3.9, which breaks one some of the type syntax found in the tests - # - name: Run Python tests - # run: | - # source venv/bin/activate - # pytest tests/*.py - - # FIXME: Linking with `cc` fails on the runner because it can't find the python3.9 library - # - name: Run Rust tests - # run: | - # source venv/bin/activate - # cargo test + run: maturin develop + - name: Run Python tests + run: pytest tests/*.py + - name: Run Rust tests + run: cargo test -- 2.47.2 From 4354000e3391af9a45a8a64ffc7ca7e5afcc033f Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 07:35:40 -0500 Subject: [PATCH 02/11] Set up venv --- .forgejo/workflows/build.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 4c57e3f..d12bb9f 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -44,10 +44,16 @@ jobs: python-version: "3.13" cache: pip - name: Set up the Python environment - run: pip install -r requirements.txt + # 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 run: maturin develop - name: Run Python tests - run: pytest tests/*.py + run: | + source venv/bin/activate + pytest tests/*.py - name: Run Rust tests run: cargo test -- 2.47.2 From d0e0f6af4fb00e32532584d980504fdf16fe4632 Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 07:45:50 -0500 Subject: [PATCH 03/11] Call maturin from venv --- .forgejo/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index d12bb9f..dbde7c8 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -50,7 +50,9 @@ jobs: source venv/bin/activate pip install -r requirements.txt - name: Build Rust code - run: maturin develop + run: | + source venv/bin/activate + maturin develop - name: Run Python tests run: | source venv/bin/activate -- 2.47.2 From 6b929834b7ec187350952d9175589754fdfe9db7 Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 08:42:46 -0500 Subject: [PATCH 04/11] Split Rust test into separate job --- .forgejo/workflows/build.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index dbde7c8..67af278 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -57,5 +57,14 @@ jobs: run: | source venv/bin/activate pytest tests/*.py + + rust-test: + name: Rust test + runs-on: ubuntu-22.04 + steps: + - name: Checkout the code + uses: actions/checkout@v4 + - name: Set up Rust + uses: https://github.com/dtolnay/rust-toolchain@stable - name: Run Rust tests run: cargo test -- 2.47.2 From e0131a1bfa104e58e1624eae44d4567dcb4803e5 Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 08:48:23 -0500 Subject: [PATCH 05/11] 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 -- 2.47.2 From b70b9a716ab2efcd41ac3655f613499dbbf6418d Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 08:51:35 -0500 Subject: [PATCH 06/11] 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) -- 2.47.2 From b390cd81c78503e310a38ddfe245ed2340b9c1bd Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 09:03:44 -0500 Subject: [PATCH 07/11] 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 -- 2.47.2 From ead4d5549c5aed822b2be46de3167262ebc933e7 Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 09:10:08 -0500 Subject: [PATCH 08/11] Temporarily disable Rust tests for brevity --- .forgejo/workflows/build.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 613d446..ee2b803 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -79,16 +79,16 @@ jobs: run: pytest tests/*.py rust-test: - name: Rust tests - runs-on: ubuntu-22.04 - steps: - - name: Checkout the code - 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 + # name: Rust tests + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout the code + # 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 -- 2.47.2 From 4b3a45463ee982d425f1201d4f378c8e5633361c Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 09:11:28 -0500 Subject: [PATCH 09/11] Try to fix wheel artifact transfer --- .forgejo/workflows/build.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index ee2b803..db124bc 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -31,7 +31,7 @@ jobs: # run: cargo clippy -- -D warnings build: - name: Build (and tests, for now) + name: Build runs-on: ubuntu-22.04 steps: - name: Checkout the code @@ -55,7 +55,7 @@ jobs: - name: Save built wheel uses: forgejo/upload-artifact@v4 with: - name: pyority_queue.whl + name: wheels path: target/wheels/*.whl compression-level: 0 @@ -74,11 +74,14 @@ jobs: - name: Retrieve built wheel uses: forgejo/download-artifact@v4 - name: Install built wheel - run: pip install pyority_queue.whl + run: | + ls -la + ls -la wheels + pip install wheels/*.whl - name: Run Python tests run: pytest tests/*.py - rust-test: + # rust-test: # name: Rust tests # runs-on: ubuntu-22.04 # steps: -- 2.47.2 From 88c4fa428ac7d0116937b3b4f5070ee8d16ca7f0 Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 09:15:59 -0500 Subject: [PATCH 10/11] Remove action debug commands --- .forgejo/workflows/build.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index db124bc..07d5a6c 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -56,7 +56,7 @@ jobs: uses: forgejo/upload-artifact@v4 with: name: wheels - path: target/wheels/*.whl + path: target/wheels/*.whl # Should only match the one target built compression-level: 0 python-test: @@ -74,10 +74,7 @@ jobs: - name: Retrieve built wheel uses: forgejo/download-artifact@v4 - name: Install built wheel - run: | - ls -la - ls -la wheels - pip install wheels/*.whl + run: pip install wheels/*.whl # Should only match the one target built - name: Run Python tests run: pytest tests/*.py -- 2.47.2 From e99d8b351395e964bd485feafcabdf63735e93ca Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 23 Feb 2025 09:16:50 -0500 Subject: [PATCH 11/11] Re-enable other CI jobs --- .forgejo/workflows/build.yaml | 76 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 07d5a6c..7b3bd7b 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: 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 @@ -78,17 +78,17 @@ jobs: - name: Run Python tests run: pytest tests/*.py - # rust-test: - # name: Rust tests - # runs-on: ubuntu-22.04 - # steps: - # - name: Checkout the code - # 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 + rust-test: + name: Rust tests + runs-on: ubuntu-22.04 + steps: + - name: Checkout the code + 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 -- 2.47.2