From 8878ff9440841073077508a806a92b96081f5d25 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 29 Jul 2026 15:47:45 +0200 Subject: [PATCH 01/14] add the parameter --- create-and-cache/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 27643f6..75db1b7 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -12,6 +12,10 @@ inputs: default: | pixi.toml pyproject.toml + manifest-path: + description: >- + Path to the manifest file (i.e., `pixi.toml`) to use for the pixi CLI. Defaults to `pixi.toml`. + default: "pixi.toml" outputs: pixi-version: From 6cc8e72145323fbe6f6afc5223d69a8d4697c733 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 29 Jul 2026 17:13:27 +0200 Subject: [PATCH 02/14] actually use the manifest path --- create-and-cache/action.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 75db1b7..291f643 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -27,6 +27,9 @@ outputs: runs: using: "composite" + env: + MANIFEST_PATH: ${{ inputs.manifest-path }} + steps: - name: Get cache key id: cache-key @@ -39,6 +42,12 @@ runs: key="pixi-lock_${PIXI_VERSION}_${HASH_FILES}_${today}" echo "key=${key}" >> "$GITHUB_OUTPUT" + - name: expected pixi lock path + id: meta + shell: bash + run: | + echo "lock-path=$(dirname $MANIFEST_PATH)/pixi.lock" >> "$GITHUB_OUTPUT" + - name: Restore pixi.lock from cache uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 id: restore @@ -57,12 +66,14 @@ runs: - name: Run pixi lock if: ${{ !steps.restore.outputs.cache-hit }} shell: bash - run: pixi lock + env: + MANIFEST_PATH: ${{ inputs.manifest-path }} + run: pixi lock --manifest-path=$MANIFEST_PATH - name: Save pixi.lock to cache uses: actions/cache/save@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 if: ${{ !steps.restore.outputs.cache-hit }} with: - path: pixi.lock + path: ${{ steps.meta.outputs.lock-path }} key: ${{ steps.cache-key.outputs.key }} enableCrossOsArchive: true From 8b09e68b19c793ac209fc8184838db2c78e42892 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 2 Aug 2026 19:56:30 +0200 Subject: [PATCH 03/14] move the env variable into the steps --- create-and-cache/action.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 291f643..13952ba 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -27,9 +27,6 @@ outputs: runs: using: "composite" - env: - MANIFEST_PATH: ${{ inputs.manifest-path }} - steps: - name: Get cache key id: cache-key @@ -45,6 +42,8 @@ runs: - name: expected pixi lock path id: meta shell: bash + env: + MANIFEST_PATH: ${{ inputs.manifest-path }} run: | echo "lock-path=$(dirname $MANIFEST_PATH)/pixi.lock" >> "$GITHUB_OUTPUT" From cbff7beb1bb4535b29b882c8f7596329af9b1d31 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 2 Aug 2026 20:11:06 +0200 Subject: [PATCH 04/14] pass the manifest to the initial pixi run --- create-and-cache/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 13952ba..c6fbe74 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -61,6 +61,7 @@ runs: with: pixi-version: ${{ inputs.pixi-version }} run-install: false + manifest-path: ${{ inputs.manifest-path }} - name: Run pixi lock if: ${{ !steps.restore.outputs.cache-hit }} From eaf26adea784bc189af15576239f3dab19142c5f Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 2 Aug 2026 20:11:26 +0200 Subject: [PATCH 05/14] remove the default (setup-pixi doesn't have one, either) --- create-and-cache/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index c6fbe74..1472855 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -15,7 +15,6 @@ inputs: manifest-path: description: >- Path to the manifest file (i.e., `pixi.toml`) to use for the pixi CLI. Defaults to `pixi.toml`. - default: "pixi.toml" outputs: pixi-version: From 5a2de7972f239040c623ed611301b0e48e7c6307 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 2 Aug 2026 20:26:00 +0200 Subject: [PATCH 06/14] calculate the lock path from the manifest --- restore/action.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/restore/action.yml b/restore/action.yml index f8fe647..d7c739c 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -33,6 +33,18 @@ runs: yesterday=$(date -d "${current_date} - 1 day" +'%Y-%m-%d' 2>/dev/null || date -j -f '%Y-%m-%d' -v-1d "${current_date}" +'%Y-%m-%d') echo "key=${base}_${yesterday}" >> "$GITHUB_OUTPUT" + - name: Calculate the lock file path + id: lock-path + run: | + if [[ -z "$MANIFEST_PATH ]]; then + lock_path=pixi.lock + else + base=$(dirname $MANIFEST_PATH) + lock_path="$base/pixi.lock" + fi + + echo "lock-path=${lock_path}" >> "$GITHUB_OUTPUT" + - name: Restore pixi.lock from cache uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 id: restore From 319b93a7b21fdc6ea28223bd7cf85366893b8a41 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 2 Aug 2026 20:26:10 +0200 Subject: [PATCH 07/14] use the newly calculated lock path --- restore/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restore/action.yml b/restore/action.yml index d7c739c..a16080f 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -49,7 +49,7 @@ runs: uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 id: restore with: - path: pixi.lock + path: ${{ steps.lock-path.outputs.lock-path }} key: ${{ inputs.cache-key }} enableCrossOsArchive: true restore-keys: | From 1ae1ad7d68a96caa53f7de7763783fed7e48cd9b Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 2 Aug 2026 20:30:39 +0200 Subject: [PATCH 08/14] specify a shell --- restore/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/restore/action.yml b/restore/action.yml index a16080f..3939738 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -35,6 +35,7 @@ runs: - name: Calculate the lock file path id: lock-path + shell: bash run: | if [[ -z "$MANIFEST_PATH ]]; then lock_path=pixi.lock From fb8dd157072e67db9bf4fb506a1423a39deb1c7c Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 2 Aug 2026 20:35:01 +0200 Subject: [PATCH 09/14] missing quote --- restore/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restore/action.yml b/restore/action.yml index 3939738..8384e01 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -37,7 +37,7 @@ runs: id: lock-path shell: bash run: | - if [[ -z "$MANIFEST_PATH ]]; then + if [[ -z "$MANIFEST_PATH" ]]; then lock_path=pixi.lock else base=$(dirname $MANIFEST_PATH) From 897237b6d0964d8f4d7274185b49648c0e76cebe Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 3 Aug 2026 09:00:12 +0800 Subject: [PATCH 10/14] Make manifest-path optional --- create-and-cache/action.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 1472855..6709f2f 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -13,8 +13,9 @@ inputs: pixi.toml pyproject.toml manifest-path: + required: false description: >- - Path to the manifest file (i.e., `pixi.toml`) to use for the pixi CLI. Defaults to `pixi.toml`. + Path to the manifest file (i.e., `pixi.toml`) to use for the pixi CLI. Defaults to `pixi.toml`, falling back to `pyproject.toml`. outputs: pixi-version: @@ -38,13 +39,24 @@ runs: key="pixi-lock_${PIXI_VERSION}_${HASH_FILES}_${today}" echo "key=${key}" >> "$GITHUB_OUTPUT" - - name: expected pixi lock path + - name: Find manifest and lock paths path id: meta shell: bash env: MANIFEST_PATH: ${{ inputs.manifest-path }} run: | - echo "lock-path=$(dirname $MANIFEST_PATH)/pixi.lock" >> "$GITHUB_OUTPUT" + if [[ -n "$MANIFEST_PATH" ]]; then + manifest_path="$MANIFEST_PATH" + elif [[ -f "pixi.toml" ]]; then + manifest_path="pixi.toml" + elif [[ -f "pyproject.toml" ]]; then + manifest_path="pyproject.toml" + else + echo "Error: no manifest file found (pixi.toml or pyproject.toml)" >&2 + exit 1 + fi + echo "manifest-path=${manifest_path}" >> "$GITHUB_OUTPUT" + echo "lock-path=$(dirname "${manifest_path}")/pixi.lock" >> "$GITHUB_OUTPUT" - name: Restore pixi.lock from cache uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 @@ -60,13 +72,13 @@ runs: with: pixi-version: ${{ inputs.pixi-version }} run-install: false - manifest-path: ${{ inputs.manifest-path }} + manifest-path: ${{ steps.meta.outputs.manifest-path }} - name: Run pixi lock if: ${{ !steps.restore.outputs.cache-hit }} shell: bash env: - MANIFEST_PATH: ${{ inputs.manifest-path }} + MANIFEST_PATH: ${{ steps.meta.outputs.manifest-path }} run: pixi lock --manifest-path=$MANIFEST_PATH - name: Save pixi.lock to cache From 9207f0dc0605458304edb7371da5c948f172dcb5 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 3 Aug 2026 09:13:51 +0800 Subject: [PATCH 11/14] Add manifest-path to restore/action.yml --- restore/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/restore/action.yml b/restore/action.yml index 8384e01..bb4d3e5 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -5,6 +5,10 @@ inputs: cache-key: description: "The cache key from create-and-cache" required: true + manifest-path: + required: false + description: >- + Path to the manifest file (i.e., `pixi.toml`) to use for the pixi CLI. Defaults to `pixi.toml`, falling back to `pyproject.toml`. runs: using: "composite" @@ -36,6 +40,8 @@ runs: - name: Calculate the lock file path id: lock-path shell: bash + env: + MANIFEST_PATH: ${{ inputs.manifest-path }} run: | if [[ -z "$MANIFEST_PATH" ]]; then lock_path=pixi.lock From 045d31b58d6a49bb6351daa510cf9d8285adbfa5 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 3 Aug 2026 09:15:51 +0800 Subject: [PATCH 12/14] Fix create-and-cache/action.yml --- create-and-cache/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 6709f2f..027b468 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -62,7 +62,7 @@ runs: uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 id: restore with: - path: pixi.lock + path: ${{ steps.meta.outputs.lock-path }} key: ${{ steps.cache-key.outputs.key }} enableCrossOsArchive: true From 2dce3e24a4ee08b15b5a324520798891b4c1cc8b Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 3 Aug 2026 23:39:48 +0200 Subject: [PATCH 13/14] only set `lock-path` to a path if manifest-path is set --- 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 027b468..f7a01a2 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -45,8 +45,10 @@ runs: env: MANIFEST_PATH: ${{ inputs.manifest-path }} run: | + lock_path="pixi.lock" if [[ -n "$MANIFEST_PATH" ]]; then manifest_path="$MANIFEST_PATH" + lock_path="$(dirname ${manifest_path})/pixi.lock" elif [[ -f "pixi.toml" ]]; then manifest_path="pixi.toml" elif [[ -f "pyproject.toml" ]]; then @@ -56,7 +58,7 @@ runs: exit 1 fi echo "manifest-path=${manifest_path}" >> "$GITHUB_OUTPUT" - echo "lock-path=$(dirname "${manifest_path}")/pixi.lock" >> "$GITHUB_OUTPUT" + echo "lock-path=${lock_path}" >> "$GITHUB_OUTPUT" - name: Restore pixi.lock from cache uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 From d5183a931cf4378efd289ce8634ff35ee2d37c50 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 3 Aug 2026 23:44:12 +0200 Subject: [PATCH 14/14] rerun ci