From 2e93363bead650f568f21e0c1564d0891c43621b Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:33:04 +0000 Subject: [PATCH 01/17] Expand test suite --- .github/workflows/test.yml | 9 +++++-- ci/test/{ => just-pixi-toml}/pixi.toml | 0 ci/test/just-pyproject-toml/pyproject.toml | 24 +++++++++++++++++++ ci/test/pyproject-and-pixi-toml/pixi.toml | 14 +++++++++++ .../pyproject-and-pixi-toml/pyproject.toml | 7 ++++++ 5 files changed, 52 insertions(+), 2 deletions(-) rename ci/test/{ => just-pixi-toml}/pixi.toml (100%) create mode 100644 ci/test/just-pyproject-toml/pyproject.toml create mode 100644 ci/test/pyproject-and-pixi-toml/pixi.toml create mode 100644 ci/test/pyproject-and-pixi-toml/pyproject.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d12f5f9..6f17014 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,10 @@ jobs: cache-pixi-lock: needs: clear-cache runs-on: ubuntu-slim + strategy: + fail-fast: false + matrix: + test-folder: [just-pixi-toml, just-pyproject-toml, pyproject-and-pixi-toml] outputs: cache-key: ${{ steps.create-and-cache.outputs.cache-key }} pixi-version: ${{ steps.create-and-cache.outputs.pixi-version }} @@ -58,7 +62,7 @@ jobs: - name: Copy test files to working directory shell: bash - run: cp -r pixi-lock/ci/test/* . + run: cp -r pixi-lock/ci/test/${{ matrix.test-folder }}/* . - name: Run create-and-cache action id: create-and-cache @@ -83,6 +87,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-slim, macos-latest, windows-latest] + test-folder: [just-pixi-toml, just-pyproject-toml, pyproject-and-pixi-toml] steps: - name: Checkout repository uses: actions/checkout@v6 @@ -91,7 +96,7 @@ jobs: - name: Copy test files to working directory shell: bash - run: cp -r pixi-lock/ci/test/* . + run: cp -r pixi-lock/ci/test/${{ matrix.test-folder }}/* . - name: Restore pixi.lock from cache uses: ./pixi-lock/restore diff --git a/ci/test/pixi.toml b/ci/test/just-pixi-toml/pixi.toml similarity index 100% rename from ci/test/pixi.toml rename to ci/test/just-pixi-toml/pixi.toml diff --git a/ci/test/just-pyproject-toml/pyproject.toml b/ci/test/just-pyproject-toml/pyproject.toml new file mode 100644 index 0000000..ea2cc8b --- /dev/null +++ b/ci/test/just-pyproject-toml/pyproject.toml @@ -0,0 +1,24 @@ +[project] +name = "just-pyproject-toml" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.12" +dependencies = [] + +[tool.pixi.workspace] +authors = ["Vecko <36369090+VeckoTheGecko@users.noreply.github.com>"] +channels = ["conda-forge"] +name = "test" +platforms = ["win-64", "linux-64", "osx-64", "osx-arm64", "linux-aarch64"] +version = "0.1.0" + +[tool.pixi.tasks] + +[tool.pixi.dependencies] +python = "*" +numpy = "*" +pandas = "*" +xarray = "*" + + diff --git a/ci/test/pyproject-and-pixi-toml/pixi.toml b/ci/test/pyproject-and-pixi-toml/pixi.toml new file mode 100644 index 0000000..0dade70 --- /dev/null +++ b/ci/test/pyproject-and-pixi-toml/pixi.toml @@ -0,0 +1,14 @@ +[workspace] +authors = ["Vecko <36369090+VeckoTheGecko@users.noreply.github.com>"] +channels = ["conda-forge"] +name = "test" +platforms = ["win-64", "linux-64", "osx-64", "osx-arm64", "linux-aarch64"] +version = "0.1.0" + +[tasks] + +[dependencies] +python = "*" +numpy = "*" +pandas = "*" +xarray = "*" diff --git a/ci/test/pyproject-and-pixi-toml/pyproject.toml b/ci/test/pyproject-and-pixi-toml/pyproject.toml new file mode 100644 index 0000000..e583bd4 --- /dev/null +++ b/ci/test/pyproject-and-pixi-toml/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "pyproject-and-pixi-toml" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.12" +dependencies = [] From 49839785f826e366cbc18a143edac900812fd65c Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:50:07 +0000 Subject: [PATCH 02/17] Combine jobs --- .github/workflows/test.yml | 39 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f17014..8d6cd6c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,9 +10,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - PIXI_VERSION: "v0.63.0" - jobs: clear-cache: runs-on: ubuntu-slim @@ -44,16 +41,15 @@ jobs: fi echo "Cache cleared" - cache-pixi-lock: + test-cache-restore-install: needs: clear-cache - runs-on: ubuntu-slim + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: + os: [ubuntu-latest, macos-latest, windows-latest] test-folder: [just-pixi-toml, just-pyproject-toml, pyproject-and-pixi-toml] - outputs: - cache-key: ${{ steps.create-and-cache.outputs.cache-key }} - pixi-version: ${{ steps.create-and-cache.outputs.pixi-version }} + pixi-version: ["", "v0.63.2"] steps: - name: Checkout repository uses: actions/checkout@v6 @@ -68,7 +64,7 @@ jobs: id: create-and-cache uses: ./pixi-lock/create-and-cache with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ matrix.pixi-version }} - name: Verify pixi.lock exists shell: bash @@ -80,30 +76,15 @@ jobs: exit 1 fi - restore-and-install: - needs: cache-pixi-lock - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-slim, macos-latest, windows-latest] - test-folder: [just-pixi-toml, just-pyproject-toml, pyproject-and-pixi-toml] - steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - path: pixi-lock - - - name: Copy test files to working directory - shell: bash - run: cp -r pixi-lock/ci/test/${{ matrix.test-folder }}/* . + - name: Remove pixi.lock + run: rm pixi.lock - name: Restore pixi.lock from cache uses: ./pixi-lock/restore with: - cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} + cache-key: ${{ steps.create-and-cache.outputs.cache-key }} - - name: Verify pixi.lock exists + - name: Verify pixi.lock exists after restore shell: bash run: | if [ -f "pixi.lock" ]; then @@ -116,7 +97,7 @@ jobs: - name: Setup pixi and install environment uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} + pixi-version: ${{ matrix.pixi-version }} - name: Verify environment installed shell: bash From b461a8ed04ba057600fc4bbaf38c783884da6b35 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:34:27 +0000 Subject: [PATCH 03/17] cleanup pixi --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d6cd6c..3934f82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,9 +76,12 @@ jobs: exit 1 fi - - name: Remove pixi.lock + - name: Cleanup pixi.lock run: rm pixi.lock + - name: Cleanup pixi.lock + run: rm -rf ~/.pixi + - name: Restore pixi.lock from cache uses: ./pixi-lock/restore with: From 827594ea9d93fb1b7195ea0ab8b3f18e50786b2a Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:41:19 +0000 Subject: [PATCH 04/17] Bash shell --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3934f82..1331ce7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,9 +77,11 @@ jobs: fi - name: Cleanup pixi.lock + shell: bash run: rm pixi.lock - - name: Cleanup pixi.lock + - name: Cleanup pixi install + shell: bash run: rm -rf ~/.pixi - name: Restore pixi.lock from cache From 123374bce4a7024f73cbd08a795befe2412db8a7 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:42:19 +0000 Subject: [PATCH 05/17] Debugging cache key --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1331ce7..df8e627 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -88,7 +88,9 @@ jobs: uses: ./pixi-lock/restore with: cache-key: ${{ steps.create-and-cache.outputs.cache-key }} - + + - name: Print cache key + run: echo "Pixi cache key is ${{ steps.create-and-cache.outputs.cache-key }}" - name: Verify pixi.lock exists after restore shell: bash run: | From 052442f0d45407f2da99c96ab2a4298020b479c4 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:42:26 +0000 Subject: [PATCH 06/17] Debugging cache key --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df8e627..dc54596 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -91,6 +91,7 @@ jobs: - name: Print cache key run: echo "Pixi cache key is ${{ steps.create-and-cache.outputs.cache-key }}" + - name: Verify pixi.lock exists after restore shell: bash run: | From 8842b03a212fcad96cf3567e89b8cf688fe4f953 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:53:05 +0000 Subject: [PATCH 07/17] reduce workflow runs --- .github/workflows/test.yml | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc54596..5f72425 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,9 +47,34 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - test-folder: [just-pixi-toml, just-pyproject-toml, pyproject-and-pixi-toml] - pixi-version: ["", "v0.63.2"] + include: + # Test OS values with fixed test-folder and pixi-version + - os: ubuntu-latest + test-folder: just-pixi-toml + pixi-version: "" + - os: macos-latest + test-folder: just-pixi-toml + pixi-version: "" + - os: windows-latest + test-folder: just-pixi-toml + pixi-version: "" + # Test test-folder values with fixed OS and pixi-version + - os: ubuntu-latest + test-folder: just-pixi-toml + pixi-version: "" + - os: ubuntu-latest + test-folder: just-pyproject-toml + pixi-version: "" + - os: ubuntu-latest + test-folder: pyproject-and-pixi-toml + pixi-version: "" + # Test pixi-version values with fixed OS and test-folder + - os: ubuntu-latest + test-folder: just-pixi-toml + pixi-version: "" + - os: ubuntu-latest + test-folder: just-pixi-toml + pixi-version: "v0.63.2" steps: - name: Checkout repository uses: actions/checkout@v6 @@ -91,7 +116,7 @@ jobs: - name: Print cache key run: echo "Pixi cache key is ${{ steps.create-and-cache.outputs.cache-key }}" - + - name: Verify pixi.lock exists after restore shell: bash run: | From fdfcb0e7cf1468dbfa02167337b47b2f3584ad3c Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:14:01 +0000 Subject: [PATCH 08/17] Flexible hashing --- create-and-cache/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 4c68b71..7cd284f 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -6,6 +6,10 @@ inputs: description: "Version of pixi to use for generating the lock file" required: false default: "latest" + hash-files: + description: "Files to use to generate the hash key for the lock file." + required: false + default: "{pixi.toml,pyproject.toml}" outputs: pixi-version: @@ -23,7 +27,7 @@ runs: shell: bash run: | today=$(date +'%Y-%m-%d') - key="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }}_${today}" + key="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles(inputs.hash-files) }}_${today}" echo "key=${key}" >> "$GITHUB_OUTPUT" - name: Restore pixi.lock from cache From 7bae3cfa6a930302994058ccd1e0881c423a1ff5 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:58:11 +0000 Subject: [PATCH 09/17] Update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 60303ca..509164a 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ jobs: | Input | Description | Required | Default | |-------|-------------|----------|---------| | `pixi-version` | Version of pixi to use for generating the lock file | No | `latest` | +| `hash-files` | Files to use to generate the hash key for the lock file | No | `{pixi.toml,pyproject.toml}` | + | Output | Description | |--------|-------------| From ae12461156f27ff13f8e719f3871cf8c3c304b4c Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:04:45 +0000 Subject: [PATCH 10/17] Add hash verification step to workflow --- .github/workflows/test.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f72425..a81662c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,29 +51,37 @@ jobs: # Test OS values with fixed test-folder and pixi-version - os: ubuntu-latest test-folder: just-pixi-toml + expected-hash: "..." pixi-version: "" - os: macos-latest test-folder: just-pixi-toml + expected-hash: "..." pixi-version: "" - os: windows-latest test-folder: just-pixi-toml + expected-hash: "..." pixi-version: "" # Test test-folder values with fixed OS and pixi-version - os: ubuntu-latest test-folder: just-pixi-toml + expected-hash: "..." pixi-version: "" - os: ubuntu-latest test-folder: just-pyproject-toml + expected-hash: "..." pixi-version: "" - os: ubuntu-latest test-folder: pyproject-and-pixi-toml + expected-hash: "..." pixi-version: "" # Test pixi-version values with fixed OS and test-folder - os: ubuntu-latest test-folder: just-pixi-toml + expected-hash: "..." pixi-version: "" - os: ubuntu-latest test-folder: just-pixi-toml + expected-hash: "..." pixi-version: "v0.63.2" steps: - name: Checkout repository @@ -100,7 +108,7 @@ jobs: echo "pixi.lock does not exist" exit 1 fi - + - name: Cleanup pixi.lock shell: bash run: rm pixi.lock @@ -114,8 +122,19 @@ jobs: with: cache-key: ${{ steps.create-and-cache.outputs.cache-key }} - - name: Print cache key - run: echo "Pixi cache key is ${{ steps.create-and-cache.outputs.cache-key }}" + - name: Verify cache key hash matches expected + shell: bash + run: | + actual_hash="${{ steps.create-and-cache.outputs.cache-key }}" + expected_hash="${{ matrix.expected-hash }}" + echo "Expected hash: $expected_hash" + echo "Actual hash: $actual_hash" + if [ "$actual_hash" != "$expected_hash" ]; then + echo "ERROR: Hash mismatch!" + echo "Please update the expected-hash in the workflow matrix to: $actual_hash" + exit 1 + fi + echo "Hash matches expected value" - name: Verify pixi.lock exists after restore shell: bash From f4e2df7f44aa9d094da633dcd8e28710a93f5f7a Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:08:59 +0000 Subject: [PATCH 11/17] Update expected hashes in workflow --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a81662c..6795b28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,37 +51,37 @@ jobs: # Test OS values with fixed test-folder and pixi-version - os: ubuntu-latest test-folder: just-pixi-toml - expected-hash: "..." + expected-hash: "pixi-lock___2026-02-24" pixi-version: "" - os: macos-latest test-folder: just-pixi-toml - expected-hash: "..." + expected-hash: "pixi-lock___2026-02-24" pixi-version: "" - os: windows-latest test-folder: just-pixi-toml - expected-hash: "..." + expected-hash: "pixi-lock___2026-02-24" pixi-version: "" # Test test-folder values with fixed OS and pixi-version - os: ubuntu-latest test-folder: just-pixi-toml - expected-hash: "..." + expected-hash: "pixi-lock___2026-02-24" pixi-version: "" - os: ubuntu-latest test-folder: just-pyproject-toml - expected-hash: "..." + expected-hash: "pixi-lock___2026-02-24" pixi-version: "" - os: ubuntu-latest test-folder: pyproject-and-pixi-toml - expected-hash: "..." + expected-hash: "pixi-lock___2026-02-24" pixi-version: "" # Test pixi-version values with fixed OS and test-folder - os: ubuntu-latest test-folder: just-pixi-toml - expected-hash: "..." + expected-hash: "pixi-lock___2026-02-24" pixi-version: "" - os: ubuntu-latest test-folder: just-pixi-toml - expected-hash: "..." + expected-hash: "pixi-lock_v0.63.2__2026-02-24" pixi-version: "v0.63.2" steps: - name: Checkout repository From 4ce1a440b324898a72f1340d5acdf85aa83352bc Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:21:37 +0000 Subject: [PATCH 12/17] Update default for hash-files Bracket notation isn't supported, but hashfiles accepts input split by newlines https://www.npmjs.com/package/@actions/glob#patterns --- create-and-cache/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 7cd284f..ff256a3 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -9,7 +9,9 @@ inputs: hash-files: description: "Files to use to generate the hash key for the lock file." required: false - default: "{pixi.toml,pyproject.toml}" + default: | + pixi.toml + pyproject.toml outputs: pixi-version: From 3c11c94f09dcec464584d51c049f4483f753fe27 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:27:01 +0000 Subject: [PATCH 13/17] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 509164a..136d4ad 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ jobs: | Input | Description | Required | Default | |-------|-------------|----------|---------| | `pixi-version` | Version of pixi to use for generating the lock file | No | `latest` | -| `hash-files` | Files to use to generate the hash key for the lock file | No | `{pixi.toml,pyproject.toml}` | +| `hash-files` | Files to use to generate the hash key for the lock file | No | `pixi.toml` and `pyproject.toml` | | Output | Description | From f88c526dd4abed7e1f5c78754b44a52e5e549f6c Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:27:11 +0000 Subject: [PATCH 14/17] Update expected-hashes --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6795b28..a84cd8c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,37 +51,37 @@ jobs: # Test OS values with fixed test-folder and pixi-version - os: ubuntu-latest test-folder: just-pixi-toml - expected-hash: "pixi-lock___2026-02-24" + expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24" pixi-version: "" - os: macos-latest test-folder: just-pixi-toml - expected-hash: "pixi-lock___2026-02-24" + expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24" pixi-version: "" - os: windows-latest test-folder: just-pixi-toml - expected-hash: "pixi-lock___2026-02-24" + expected-hash: "pixi-lock__adbacdefe20c62f204989acf366ef09911f3af89f066088613341b946be131e8_2026-02-24" pixi-version: "" # Test test-folder values with fixed OS and pixi-version - os: ubuntu-latest test-folder: just-pixi-toml - expected-hash: "pixi-lock___2026-02-24" + expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24" pixi-version: "" - os: ubuntu-latest test-folder: just-pyproject-toml - expected-hash: "pixi-lock___2026-02-24" + expected-hash: "pixi-lock__5626c1bd50c85d7a0f8cd9758f61f1d7ee8f868b7a149f7bd970dcd846b60974_2026-02-24" pixi-version: "" - os: ubuntu-latest test-folder: pyproject-and-pixi-toml - expected-hash: "pixi-lock___2026-02-24" + expected-hash: "pixi-lock__b5bae43771086cb1dd79c43dc06881f8b0e006ad8c54e7269dad1a4f8ce96522_2026-02-24" pixi-version: "" # Test pixi-version values with fixed OS and test-folder - os: ubuntu-latest test-folder: just-pixi-toml - expected-hash: "pixi-lock___2026-02-24" + expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24" pixi-version: "" - os: ubuntu-latest test-folder: just-pixi-toml - expected-hash: "pixi-lock_v0.63.2__2026-02-24" + expected-hash: "pixi-lock_v0.63.2_69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24" pixi-version: "v0.63.2" steps: - name: Checkout repository From f434faff47b94fb9a9b734f4fdfbcae953385a7e Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:20:05 +0000 Subject: [PATCH 15/17] move --- .github/workflows/test.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a84cd8c..9bdd74b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -99,6 +99,20 @@ jobs: with: pixi-version: ${{ matrix.pixi-version }} + - name: Verify cache key hash matches expected + shell: bash + run: | + actual_hash="${{ steps.create-and-cache.outputs.cache-key }}" + expected_hash="${{ matrix.expected-hash }}" + echo "Expected hash: $expected_hash" + echo "Actual hash: $actual_hash" + if [ "$actual_hash" != "$expected_hash" ]; then + echo "ERROR: Hash mismatch!" + echo "Please update the expected-hash in the workflow matrix to: $actual_hash" + exit 1 + fi + echo "Hash matches expected value" + - name: Verify pixi.lock exists shell: bash run: | @@ -121,21 +135,7 @@ jobs: uses: ./pixi-lock/restore with: cache-key: ${{ steps.create-and-cache.outputs.cache-key }} - - - name: Verify cache key hash matches expected - shell: bash - run: | - actual_hash="${{ steps.create-and-cache.outputs.cache-key }}" - expected_hash="${{ matrix.expected-hash }}" - echo "Expected hash: $expected_hash" - echo "Actual hash: $actual_hash" - if [ "$actual_hash" != "$expected_hash" ]; then - echo "ERROR: Hash mismatch!" - echo "Please update the expected-hash in the workflow matrix to: $actual_hash" - exit 1 - fi - echo "Hash matches expected value" - + - name: Verify pixi.lock exists after restore shell: bash run: | From e20a170cd9fd7272be869db24217a99866391ef5 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:20:54 +0000 Subject: [PATCH 16/17] pre-commmit --- .github/workflows/test.yml | 4 +-- README.md | 31 +++++++++++----------- ci/test/just-pyproject-toml/pyproject.toml | 2 -- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9bdd74b..a4e3c32 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: echo "pixi.lock does not exist" exit 1 fi - + - name: Cleanup pixi.lock shell: bash run: rm pixi.lock @@ -135,7 +135,7 @@ jobs: uses: ./pixi-lock/restore with: cache-key: ${{ steps.create-and-cache.outputs.cache-key }} - + - name: Verify pixi.lock exists after restore shell: bash run: | diff --git a/README.md b/README.md index 136d4ad..ce44449 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,9 @@ This repo provides two GitHub Actions for generating and caching `pixi.lock` fil This two-action pattern is so that the lockfile can be omitted from the git history, but still be generated in a performant manner (i.e., regenerated -and cached with a key that depends on `pixi.toml` and the date - +and cached with a key that depends on `pixi.toml` and the date - then shared across jobs). - ## Usage ```yaml @@ -25,7 +24,7 @@ jobs: pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} steps: - uses: actions/checkout@v4 - - uses: Parcels-code/pixi-lock/create-and-cache@... # TODO: Copy the hash for the rev you want to install from + - uses: Parcels-code/pixi-lock/create-and-cache@... # TODO: Copy the hash for the rev you want to install from id: pixi-lock with: pixi-version: ... # TODO: update with your selected pixi version @@ -45,7 +44,7 @@ jobs: - uses: Parcels-code/pixi-lock/restore@ # TODO: Copy the hash for the rev you want to install from (same as above) with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - - uses: prefix-dev/setup-pixi@v... # TODO: update with your selected setup-pixi version + - uses: prefix-dev/setup-pixi@v... # TODO: update with your selected setup-pixi version with: pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} # ... your CI steps @@ -55,22 +54,21 @@ jobs: #### `create-and-cache` -| Input | Description | Required | Default | -|-------|-------------|----------|---------| -| `pixi-version` | Version of pixi to use for generating the lock file | No | `latest` | -| `hash-files` | Files to use to generate the hash key for the lock file | No | `pixi.toml` and `pyproject.toml` | - +| Input | Description | Required | Default | +| -------------- | ------------------------------------------------------- | -------- | -------------------------------- | +| `pixi-version` | Version of pixi to use for generating the lock file | No | `latest` | +| `hash-files` | Files to use to generate the hash key for the lock file | No | `pixi.toml` and `pyproject.toml` | -| Output | Description | -|--------|-------------| -| `pixi-version` | The pixi version used | -| `cache-key` | The cache key (includes today's date) | +| Output | Description | +| -------------- | ------------------------------------- | +| `pixi-version` | The pixi version used | +| `cache-key` | The cache key (includes today's date) | #### `restore` -| Input | Description | Required | -|-------|-------------|----------| -| `cache-key` | The cache key from `create-and-cache` | Yes | +| Input | Description | Required | +| ----------- | ------------------------------------- | -------- | +| `cache-key` | The cache key from `create-and-cache` | Yes | > [!NOTE] > The cache key includes the current date, so the lock file is regenerated daily. @@ -85,6 +83,7 @@ When developing and testing _library_ code, we don't want our environments to st The _easiest_ way to test against the latest versions of packages - and avoid the noisy commit history (and additional overhead) of regularly updating a lock file in git - is instead to ignore the lock file and rely on developers and CI to generate their own lock files. This much simpler setup forgoes perfect reprodubility between developer machines, and with CI machines - which may be a worthwhile tradeoff for your project. See the following threads for more detailed discussion: + - [prefix.dev Discord: Should you commit the lockfile](https://discord.com/channels/1082332781146800168/1462778624212996209) - [Scientific Python Discord: lock files for libraries](https://discord.com/channels/786703927705862175/1450619697224487083) - https://github.com/prefix-dev/pixi/issues/5325 diff --git a/ci/test/just-pyproject-toml/pyproject.toml b/ci/test/just-pyproject-toml/pyproject.toml index ea2cc8b..c0a0592 100644 --- a/ci/test/just-pyproject-toml/pyproject.toml +++ b/ci/test/just-pyproject-toml/pyproject.toml @@ -20,5 +20,3 @@ python = "*" numpy = "*" pandas = "*" xarray = "*" - - From 2b3816d1db3cf2d16479a1b63df2c603c71098cf Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:22:50 +0000 Subject: [PATCH 17/17] Update hash --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4e3c32..91f587f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,7 +68,7 @@ jobs: pixi-version: "" - os: ubuntu-latest test-folder: just-pyproject-toml - expected-hash: "pixi-lock__5626c1bd50c85d7a0f8cd9758f61f1d7ee8f868b7a149f7bd970dcd846b60974_2026-02-24" + expected-hash: "pixi-lock__4a057faded2062ff018955c0be1db1b9e1d2fb8d1fe4303d8b778af7fd9e411d_2026-02-24" pixi-version: "" - os: ubuntu-latest test-folder: pyproject-and-pixi-toml