From 9164eaa179dfa785a1467b0e8924aab5b8c4b22e Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 11:55:23 +0100 Subject: [PATCH 01/20] Initial commit --- .gitattributes | 2 ++ .github/workflows/test.yml | 0 .gitignore | 5 +++++ README.md | 14 ++++++++++++++ ci/test/pixi.toml | 13 +++++++++++++ 5 files changed, 34 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/workflows/test.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 ci/test/pixi.toml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..997504b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# SCM syntax highlighting & preventing 3-way merges +pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e69de29 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d2568c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# pixi environments +.pixi/* +!.pixi/config.toml + +pixi.lock \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..059d710 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# create-pixi-lock + +> [!NOTE] +> This repo is likely to be moved to https://github.com/xarray-contrib + +This action creates a `pixi.lock` file and caches it for future use. Subsequent runs of this action on the same day restore the lock file instead of generating it anew. + +## Why not commit the lock file? +Committing your lock file is considered good practice when working on application code. Providing fixed package versions results in perfect reproducibility of environments between machines, and hence also reproducibility of results. + +When developing and testing _library_ code, we don't want our environments to stay completely fixed - we want to test against environments covering a wide range of package versions to ensure compatability, including an environment includ the latest available versions of packages. + +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 forgoes perfect reprodubility between developer machines, and with CI machines. + diff --git a/ci/test/pixi.toml b/ci/test/pixi.toml new file mode 100644 index 0000000..1ac33f4 --- /dev/null +++ b/ci/test/pixi.toml @@ -0,0 +1,13 @@ +[workspace] +authors = ["Vecko <36369090+VeckoTheGecko@users.noreply.github.com>"] +channels = ["conda-forge"] +name = "test" +platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] +version = "0.1.0" + +[tasks] + +[dependencies] +xarray = ">=2025.12.0" +pandas = ">=2.3" +python = ">=3.9" From dbe36f80ba8fa34f949c6c7f34f792c3d79eb16d Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:00:57 +0100 Subject: [PATCH 02/20] Initial draft of action and testing workflow --- .github/workflows/test.yml | 31 ++++++++++++++++++++++++++++ action.yml | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 action.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e69de29..cae209d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + path: create-pixi-lock + + - name: Copy test files to working directory + run: cp -r create-pixi-lock/ci/test/* . + + - name: Run create-pixi-lock action + uses: ./create-pixi-lock + + - name: Verify pixi.lock exists + run: | + if [ -f "pixi.lock" ]; then + echo "pixi.lock exists" + else + echo "pixi.lock does not exist" + exit 1 + fi diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..259301c --- /dev/null +++ b/action.yml @@ -0,0 +1,42 @@ +name: Create Pixi Lock +description: Generate and cache a pixi.lock file, restoring from cache when available + +inputs: + pixi-version: + description: "Version of pixi to use for generating the lock file" + required: false + default: "latest" + +runs: + using: "composite" + steps: + - name: Get current date + id: date + shell: bash + run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" + + - name: Restore pixi.lock from cache + uses: actions/cache/restore@v5 + id: restore + with: + path: pixi.lock + key: ${{ steps.date.outputs.date }}_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }} + + - name: Setup pixi + uses: prefix-dev/setup-pixi@v0.9.3 + if: ${{ !steps.restore.outputs.cache-hit }} + with: + pixi-version: ${{ inputs.pixi-version }} + run-install: false + + - name: Run pixi lock + if: ${{ !steps.restore.outputs.cache-hit }} + shell: bash + run: pixi lock + + - name: Save pixi.lock to cache + uses: actions/cache/save@v5 + if: ${{ !steps.restore.outputs.cache-hit }} + with: + path: pixi.lock + key: ${{ steps.date.outputs.date }}_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }} From c6461a1a900e3d0de2f1766b5feb440876757d78 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:09:17 +0100 Subject: [PATCH 03/20] Add cache frequency to action --- action.yml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 259301c..216a663 100644 --- a/action.yml +++ b/action.yml @@ -6,21 +6,41 @@ inputs: description: "Version of pixi to use for generating the lock file" required: false default: "latest" + cache-frequency: + description: "How often to regenerate the lock file: 'daily', 'weekly', or 'monthly'" + required: false + default: "daily" runs: using: "composite" steps: - - name: Get current date - id: date + - name: Get cache key + id: cache-key shell: bash - run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" + run: | + case "${{ inputs.cache-frequency }}" in + daily) + key=$(date +'%Y-%m-%d') + ;; + weekly) + key=$(date +'%Y-week-%V') + ;; + monthly) + key=$(date +'%Y-month-%m') + ;; + *) + echo "Invalid cache-frequency: ${{ inputs.cache-frequency }}. Must be 'daily', 'weekly', or 'monthly'." + exit 1 + ;; + esac + echo "key=$key" >> "$GITHUB_OUTPUT" - name: Restore pixi.lock from cache uses: actions/cache/restore@v5 id: restore with: path: pixi.lock - key: ${{ steps.date.outputs.date }}_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }} + key: ${{ steps.cache-key.outputs.key }}_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }} - name: Setup pixi uses: prefix-dev/setup-pixi@v0.9.3 @@ -39,4 +59,4 @@ runs: if: ${{ !steps.restore.outputs.cache-hit }} with: path: pixi.lock - key: ${{ steps.date.outputs.date }}_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }} + key: ${{ steps.cache-key.outputs.key }}_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }} From 97e4e5e155485e0c2a0f2fc4d274ec0450c4868b Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:09:57 +0100 Subject: [PATCH 04/20] Add check in `test.yml` --- .github/workflows/test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cae209d..724a6f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,3 +29,15 @@ jobs: echo "pixi.lock does not exist" exit 1 fi + + - name: Setup pixi and install environment + uses: prefix-dev/setup-pixi@v0.9.3 + + - name: Verify environment installed + run: | + if [ -d ".pixi/envs/default" ]; then + echo "Environment installed successfully" + else + echo "Environment not installed" + exit 1 + fi From 1bffeff9c33ea2dc4f39e416ed2775c225fd17b3 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:10:57 +0100 Subject: [PATCH 05/20] Update --- ci/test/pixi.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/test/pixi.toml b/ci/test/pixi.toml index 1ac33f4..b13c2c1 100644 --- a/ci/test/pixi.toml +++ b/ci/test/pixi.toml @@ -8,6 +8,7 @@ version = "0.1.0" [tasks] [dependencies] -xarray = ">=2025.12.0" -pandas = ">=2.3" -python = ">=3.9" +python = "*" +numpy = "*" +pandas = "*" +xarray = "*" From e82dcf7ced2736efa28c2fa8684ac1c9d5cb2e4d Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:26:07 +0100 Subject: [PATCH 06/20] Add test matrices and concurrency --- .github/workflows/test.yml | 15 +++++++++++++-- action.yml | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 724a6f1..0327b28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test +name: Test cache-pixi-lock action on: push: @@ -6,9 +6,18 @@ on: pull_request: branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + cache-frequency: [daily, weekly, monthly] steps: - name: Checkout repository uses: actions/checkout@v6 @@ -20,6 +29,8 @@ jobs: - name: Run create-pixi-lock action uses: ./create-pixi-lock + with: + cache-frequency: ${{ matrix.cache-frequency }} - name: Verify pixi.lock exists run: | diff --git a/action.yml b/action.yml index 216a663..76870ed 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: Create Pixi Lock -description: Generate and cache a pixi.lock file, restoring from cache when available +description: Generate and cache a pixi.lock file, restoring from cache when available. inputs: pixi-version: From b473bf1ab9e615e2677f178af7700e4a28761435 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:57:21 +0100 Subject: [PATCH 07/20] Update branches --- .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 0327b28..75669fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: Test cache-pixi-lock action on: push: - branches: [main] + branches: [main, test-me/*] pull_request: branches: [main] From 85a6a81a85ecba6672001ea713d6987ceec979aa Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:03:34 +0100 Subject: [PATCH 08/20] Update supported platforms --- ci/test/pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/pixi.toml b/ci/test/pixi.toml index b13c2c1..0dade70 100644 --- a/ci/test/pixi.toml +++ b/ci/test/pixi.toml @@ -2,7 +2,7 @@ authors = ["Vecko <36369090+VeckoTheGecko@users.noreply.github.com>"] channels = ["conda-forge"] name = "test" -platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] +platforms = ["win-64", "linux-64", "osx-64", "osx-arm64", "linux-aarch64"] version = "0.1.0" [tasks] From cec51cbcbf41a8caabc9e0cf6f5fab5b0cca2964 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:03:58 +0100 Subject: [PATCH 09/20] Add hooks --- .gitignore | 2 +- .pre-commit-config.yaml | 26 ++++++++++++++++++++++++++ README.md | 4 ++-- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.gitignore b/.gitignore index 6d2568c..c94f60b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ .pixi/* !.pixi/config.toml -pixi.lock \ No newline at end of file +pixi.lock diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..44fef91 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-ast + - id: check-json + types: [text] + files: \.(json|ipynb)$ + - repo: https://github.com/rbubley/mirrors-prettier # Update mirror as official mirror is deprecated + rev: v3.6.2 + hooks: + - id: prettier + - repo: https://github.com/ComPWA/taplo-pre-commit + rev: v0.9.3 + hooks: + - id: taplo-format + args: + [ + "--option", + "array_auto_collapse=false", + "--option", + "align_comments=false", + ] diff --git a/README.md b/README.md index 059d710..6111416 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ This action creates a `pixi.lock` file and caches it for future use. Subsequent runs of this action on the same day restore the lock file instead of generating it anew. ## Why not commit the lock file? + Committing your lock file is considered good practice when working on application code. Providing fixed package versions results in perfect reproducibility of environments between machines, and hence also reproducibility of results. When developing and testing _library_ code, we don't want our environments to stay completely fixed - we want to test against environments covering a wide range of package versions to ensure compatability, including an environment includ the latest available versions of packages. -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 forgoes perfect reprodubility between developer machines, and with CI machines. - +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 forgoes perfect reprodubility between developer machines, and with CI machines. From 0913a52ac8ed42fd874237efb7e416a0fb072507 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:11:23 +0100 Subject: [PATCH 10/20] Windows compat --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75669fd..1355a8c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,7 @@ jobs: path: create-pixi-lock - name: Copy test files to working directory + shell: bash run: cp -r create-pixi-lock/ci/test/* . - name: Run create-pixi-lock action @@ -33,6 +34,7 @@ jobs: cache-frequency: ${{ matrix.cache-frequency }} - name: Verify pixi.lock exists + shell: bash run: | if [ -f "pixi.lock" ]; then echo "pixi.lock exists" @@ -45,6 +47,7 @@ jobs: uses: prefix-dev/setup-pixi@v0.9.3 - name: Verify environment installed + shell: bash run: | if [ -d ".pixi/envs/default" ]; then echo "Environment installed successfully" From 58b4056a2ab053333462156a34d3c09bbdd74503 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:38:01 +0100 Subject: [PATCH 11/20] Update README --- .github/workflows/test.yml | 7 +++++++ README.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1355a8c..21c1788 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + PIXI_VERSION: "v0.63.0" + jobs: test: runs-on: ${{ matrix.os }} @@ -32,6 +35,7 @@ jobs: uses: ./create-pixi-lock with: cache-frequency: ${{ matrix.cache-frequency }} + pixi-version: ${{ env.PIXI_VERSION }}$ - name: Verify pixi.lock exists shell: bash @@ -45,6 +49,9 @@ jobs: - name: Setup pixi and install environment uses: prefix-dev/setup-pixi@v0.9.3 + with: + pixi-version: ${{ env.PIXI_VERSION }}$ + - name: Verify environment installed shell: bash diff --git a/README.md b/README.md index 6111416..30704f3 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,35 @@ This action creates a `pixi.lock` file and caches it for future use. Subsequent runs of this action on the same day restore the lock file instead of generating it anew. + +## Usage + +Basic usage with a set version of Pixi as well as daily cached lockfile: + +```yaml +env: + PIXI_VERSION: "v0.63.0" + +# ... +steps: + - uses: actions/checkout@v4 + + - uses: Parcels-code/create-pixi-lock@v1 + with: + pixi-version: ${{ env.PIXI_VERSION }}$ # Default is latest + cache-frequency: daily # options are "daily", "weekly", "monthly". Default "daily" + - uses: prefix-dev/setup-pixi@v0.9.3 + with: + pixi-version: ${{ env.PIXI_VERSION }}$ +``` + +> [!NOTE] +> Pinning your Pixi version in CI and updating this pin manually ensures better +> Stability. Otherwise updates to Pixi which (a) change the format of the lock > file would break your CI for a period of `cache-frequency`, or (b) change the format of +> `pixi.toml`, which would break your CI until you fix it. +> This avoids any potentially breaking changes down the line (e.g., changes +> in lock file behaviour + ## Why not commit the lock file? Committing your lock file is considered good practice when working on application code. Providing fixed package versions results in perfect reproducibility of environments between machines, and hence also reproducibility of results. @@ -12,3 +41,11 @@ Committing your lock file is considered good practice when working on applicatio When developing and testing _library_ code, we don't want our environments to stay completely fixed - we want to test against environments covering a wide range of package versions to ensure compatability, including an environment includ the latest available versions of packages. 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 forgoes perfect reprodubility between developer machines, and with CI machines. + + +## Dev notes + +### Release checklist + +- Update the `README.md` bumping the version of action +- Cut release \ No newline at end of file From 6e70a6e89417e8fffda1b99c00fa84fd152ee89a Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:41:56 +0100 Subject: [PATCH 12/20] update readme --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 30704f3..fe890d0 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ steps: - uses: Parcels-code/create-pixi-lock@v1 with: - pixi-version: ${{ env.PIXI_VERSION }}$ # Default is latest + pixi-version: ${{ env.PIXI_VERSION }}$ # Default is latest - same as setup-pixi cache-frequency: daily # options are "daily", "weekly", "monthly". Default "daily" - uses: prefix-dev/setup-pixi@v0.9.3 with: @@ -29,10 +29,9 @@ steps: > [!NOTE] > Pinning your Pixi version in CI and updating this pin manually ensures better -> Stability. Otherwise updates to Pixi which (a) change the format of the lock > file would break your CI for a period of `cache-frequency`, or (b) change the format of -> `pixi.toml`, which would break your CI until you fix it. -> This avoids any potentially breaking changes down the line (e.g., changes -> in lock file behaviour +> stability. Otherwise updates to Pixi which introduce breaking changes in: +> - (a) the format of the lock file - which would break your CI for a period of `cache-frequency`, or +> - (b) the format of `pixi.toml` - which would break your CI until you fix it. ## Why not commit the lock file? From be63ffaa76bd4b06f762c8e9d80d09c1c887a4f0 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:43:07 +0100 Subject: [PATCH 13/20] Bugfix --- .github/workflows/test.yml | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 21c1788..f450a65 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: uses: ./create-pixi-lock with: cache-frequency: ${{ matrix.cache-frequency }} - pixi-version: ${{ env.PIXI_VERSION }}$ + pixi-version: ${{ env.PIXI_VERSION }} - name: Verify pixi.lock exists shell: bash @@ -50,7 +50,7 @@ jobs: - name: Setup pixi and install environment uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }}$ + pixi-version: ${{ env.PIXI_VERSION }} - name: Verify environment installed diff --git a/README.md b/README.md index fe890d0..62ab289 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ steps: - uses: Parcels-code/create-pixi-lock@v1 with: - pixi-version: ${{ env.PIXI_VERSION }}$ # Default is latest - same as setup-pixi + pixi-version: ${{ env.PIXI_VERSION }} # Default is latest - same as setup-pixi cache-frequency: daily # options are "daily", "weekly", "monthly". Default "daily" - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }}$ + pixi-version: ${{ env.PIXI_VERSION }} ``` > [!NOTE] From c2a88f479e999349bb90f25a579d912ec0db6ab1 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:42:54 +0100 Subject: [PATCH 14/20] Split actions into two --- .github/workflows/test.yml | 41 +++++++++++++++++++----- README.md | 52 ++++++++++++++++++++----------- action.yml | 62 ------------------------------------- create-and-cache/action.yml | 53 +++++++++++++++++++++++++++++++ restore/action.yml | 31 +++++++++++++++++++ 5 files changed, 151 insertions(+), 88 deletions(-) delete mode 100644 action.yml create mode 100644 create-and-cache/action.yml create mode 100644 restore/action.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f450a65..5c2fd7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test cache-pixi-lock action +name: Test pixi-lock actions on: push: @@ -14,27 +14,53 @@ env: PIXI_VERSION: "v0.63.0" jobs: + cache-pixi-lock: + runs-on: ubuntu-latest + 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/* . + + - name: Run create-and-cache action + uses: ./pixi-lock/create-and-cache + with: + pixi-version: ${{ env.PIXI_VERSION }} + + - name: Verify pixi.lock exists + shell: bash + run: | + if [ -f "pixi.lock" ]; then + echo "pixi.lock exists" + else + echo "pixi.lock does not exist" + exit 1 + fi + test: + needs: cache-pixi-lock runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - cache-frequency: [daily, weekly, monthly] steps: - name: Checkout repository uses: actions/checkout@v6 with: - path: create-pixi-lock + path: pixi-lock - name: Copy test files to working directory shell: bash - run: cp -r create-pixi-lock/ci/test/* . + run: cp -r pixi-lock/ci/test/* . - - name: Run create-pixi-lock action - uses: ./create-pixi-lock + - name: Restore pixi.lock from cache + uses: ./pixi-lock/restore with: - cache-frequency: ${{ matrix.cache-frequency }} pixi-version: ${{ env.PIXI_VERSION }} - name: Verify pixi.lock exists @@ -52,7 +78,6 @@ jobs: with: pixi-version: ${{ env.PIXI_VERSION }} - - name: Verify environment installed shell: bash run: | diff --git a/README.md b/README.md index 62ab289..6ca4331 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,52 @@ -# create-pixi-lock +# pixi-lock > [!NOTE] > This repo is likely to be moved to https://github.com/xarray-contrib -This action creates a `pixi.lock` file and caches it for future use. Subsequent runs of this action on the same day restore the lock file instead of generating it anew. +This repo provides two GitHub Actions for managing `pixi.lock` files with caching: +- **`create-and-cache`**: Generates a `pixi.lock` file and caches it +- **`restore`**: Restores the cached `pixi.lock` file in downstream jobs + +This two-action pattern is designed for CI workflows where you want to generate the lock file once and reuse it across multiple matrix jobs. -## Usage -Basic usage with a set version of Pixi as well as daily cached lockfile: +## Usage ```yaml env: PIXI_VERSION: "v0.63.0" -# ... -steps: - - uses: actions/checkout@v4 - - - uses: Parcels-code/create-pixi-lock@v1 - with: - pixi-version: ${{ env.PIXI_VERSION }} # Default is latest - same as setup-pixi - cache-frequency: daily # options are "daily", "weekly", "monthly". Default "daily" - - uses: prefix-dev/setup-pixi@v0.9.3 - with: - pixi-version: ${{ env.PIXI_VERSION }} +jobs: + cache-pixi-lock: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Parcels-code/pixi-lock/create-and-cache@v1 + with: + pixi-version: ${{ env.PIXI_VERSION }} + + ci: + needs: cache-pixi-lock + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v4 + - uses: Parcels-code/pixi-lock/restore@v1 + with: + pixi-version: ${{ env.PIXI_VERSION }} + - uses: prefix-dev/setup-pixi@v0.9.3 + with: + pixi-version: ${{ env.PIXI_VERSION }} + # ... your CI steps ``` > [!NOTE] -> Pinning your Pixi version in CI and updating this pin manually ensures better +> Using the same Pixi version in CI as from lockfile generation ensures better > stability. Otherwise updates to Pixi which introduce breaking changes in: -> - (a) the format of the lock file - which would break your CI for a period of `cache-frequency`, or +> - (a) the format of the lock file - which would break your CI for the day, or > - (b) the format of `pixi.toml` - which would break your CI until you fix it. ## Why not commit the lock file? @@ -47,4 +63,4 @@ The easiest way to test against the latest versions of packages - and avoid the ### Release checklist - Update the `README.md` bumping the version of action -- Cut release \ No newline at end of file +- Cut release diff --git a/action.yml b/action.yml deleted file mode 100644 index 76870ed..0000000 --- a/action.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Create Pixi Lock -description: Generate and cache a pixi.lock file, restoring from cache when available. - -inputs: - pixi-version: - description: "Version of pixi to use for generating the lock file" - required: false - default: "latest" - cache-frequency: - description: "How often to regenerate the lock file: 'daily', 'weekly', or 'monthly'" - required: false - default: "daily" - -runs: - using: "composite" - steps: - - name: Get cache key - id: cache-key - shell: bash - run: | - case "${{ inputs.cache-frequency }}" in - daily) - key=$(date +'%Y-%m-%d') - ;; - weekly) - key=$(date +'%Y-week-%V') - ;; - monthly) - key=$(date +'%Y-month-%m') - ;; - *) - echo "Invalid cache-frequency: ${{ inputs.cache-frequency }}. Must be 'daily', 'weekly', or 'monthly'." - exit 1 - ;; - esac - echo "key=$key" >> "$GITHUB_OUTPUT" - - - name: Restore pixi.lock from cache - uses: actions/cache/restore@v5 - id: restore - with: - path: pixi.lock - key: ${{ steps.cache-key.outputs.key }}_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }} - - - name: Setup pixi - uses: prefix-dev/setup-pixi@v0.9.3 - if: ${{ !steps.restore.outputs.cache-hit }} - with: - pixi-version: ${{ inputs.pixi-version }} - run-install: false - - - name: Run pixi lock - if: ${{ !steps.restore.outputs.cache-hit }} - shell: bash - run: pixi lock - - - name: Save pixi.lock to cache - uses: actions/cache/save@v5 - if: ${{ !steps.restore.outputs.cache-hit }} - with: - path: pixi.lock - key: ${{ steps.cache-key.outputs.key }}_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }} diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml new file mode 100644 index 0000000..dd46383 --- /dev/null +++ b/create-and-cache/action.yml @@ -0,0 +1,53 @@ +name: Create and Cache Pixi Lock +description: Generate a pixi.lock file and cache it for use by other jobs. + +inputs: + pixi-version: + description: "Version of pixi to use for generating the lock file" + required: false + default: "latest" + +outputs: + pixi-version: + description: "The pixi version used (for passing to downstream jobs)" + value: ${{ inputs.pixi-version }} + cache-key: + description: "The cache key used (for debugging)" + value: ${{ steps.cache-key.outputs.key }} + +runs: + using: "composite" + steps: + - name: Get cache key + id: cache-key + shell: bash + run: | + today=$(date +'%Y-%m-%d') + base="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }}" + echo "key=${base}_${today}" >> "$GITHUB_OUTPUT" + + - name: Restore pixi.lock from cache + uses: actions/cache/restore@v5 + id: restore + with: + path: pixi.lock + key: ${{ steps.cache-key.outputs.key }} + + - name: Setup pixi + uses: prefix-dev/setup-pixi@v0.9.3 + if: ${{ !steps.restore.outputs.cache-hit }} + with: + pixi-version: ${{ inputs.pixi-version }} + run-install: false + + - name: Run pixi lock + if: ${{ !steps.restore.outputs.cache-hit }} + shell: bash + run: pixi lock + + - name: Save pixi.lock to cache + uses: actions/cache/save@v5 + if: ${{ !steps.restore.outputs.cache-hit }} + with: + path: pixi.lock + key: ${{ steps.cache-key.outputs.key }} diff --git a/restore/action.yml b/restore/action.yml new file mode 100644 index 0000000..0e9f6e1 --- /dev/null +++ b/restore/action.yml @@ -0,0 +1,31 @@ +name: Restore Pixi Lock +description: Restore a previously cached pixi.lock file. + +inputs: + pixi-version: + description: "Version of pixi used when creating the lock file (must match create-and-cache)" + required: false + default: "latest" + +runs: + using: "composite" + steps: + - name: Get cache key + id: cache-key + shell: bash + run: | + today=$(date +'%Y-%m-%d') + yesterday=$(date -d 'yesterday' +'%Y-%m-%d' 2>/dev/null || date -v-1d +'%Y-%m-%d') + base="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }}" + echo "key=${base}_${today}" >> "$GITHUB_OUTPUT" + echo "restore-key=${base}_${yesterday}" >> "$GITHUB_OUTPUT" + + - name: Restore pixi.lock from cache + uses: actions/cache/restore@v5 + id: restore + with: + path: pixi.lock + key: ${{ steps.cache-key.outputs.key }} + restore-keys: | + ${{ steps.cache-key.outputs.restore-key }} + fail-on-cache-miss: true From c80096161287a82c5e73052d72742731490e5e90 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:01:57 +0100 Subject: [PATCH 15/20] Update --- restore/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restore/action.yml b/restore/action.yml index 0e9f6e1..1523951 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -10,7 +10,7 @@ inputs: runs: using: "composite" steps: - - name: Get cache key + - name: Get cache key # fallback to yesterdays cache (in case of workflow runs at midnight) id: cache-key shell: bash run: | From bf7fcb1e774559757fe821349bce95ee9bf3bc3d Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:09:59 +0100 Subject: [PATCH 16/20] Update actions to take the cache-keys explicitly --- .github/workflows/test.yml | 8 ++++++- README.md | 42 ++++++++++++++++++++++++++++--------- create-and-cache/action.yml | 7 ++++++- restore/action.yml | 24 +++++++-------------- 4 files changed, 53 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c2fd7c..c7ac1d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,6 +16,10 @@ env: jobs: cache-pixi-lock: runs-on: ubuntu-latest + outputs: + cache-key: ${{ steps.create-and-cache.outputs.cache-key }} + fallback-key: ${{ steps.create-and-cache.outputs.fallback-key }} + pixi-version: ${{ steps.create-and-cache.outputs.pixi-version }} steps: - name: Checkout repository uses: actions/checkout@v6 @@ -27,6 +31,7 @@ jobs: run: cp -r pixi-lock/ci/test/* . - name: Run create-and-cache action + id: create-and-cache uses: ./pixi-lock/create-and-cache with: pixi-version: ${{ env.PIXI_VERSION }} @@ -61,7 +66,8 @@ jobs: - name: Restore pixi.lock from cache uses: ./pixi-lock/restore with: - pixi-version: ${{ env.PIXI_VERSION }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} + fallback-key: ${{ needs.cache-pixi-lock.outputs.fallback-key }} - name: Verify pixi.lock exists shell: bash diff --git a/README.md b/README.md index 6ca4331..75ebb22 100644 --- a/README.md +++ b/README.md @@ -14,17 +14,19 @@ This two-action pattern is designed for CI workflows where you want to generate ## Usage ```yaml -env: - PIXI_VERSION: "v0.63.0" - jobs: cache-pixi-lock: runs-on: ubuntu-latest + outputs: + cache-key: ${{ steps.pixi-lock.outputs.cache-key }} + fallback-key: ${{ steps.pixi-lock.outputs.fallback-key }} + pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} steps: - uses: actions/checkout@v4 - uses: Parcels-code/pixi-lock/create-and-cache@v1 + id: pixi-lock with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: v0.63.0 ci: needs: cache-pixi-lock @@ -36,18 +38,38 @@ jobs: - uses: actions/checkout@v4 - uses: Parcels-code/pixi-lock/restore@v1 with: - pixi-version: ${{ env.PIXI_VERSION }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} + fallback-key: ${{ needs.cache-pixi-lock.outputs.fallback-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} # ... your CI steps ``` +### Inputs & Outputs + +#### `create-and-cache` + +| Input | Description | Required | Default | +|-------|-------------|----------|---------| +| `pixi-version` | Version of pixi to use for generating the lock file | No | `latest` | + +| Output | Description | +|--------|-------------| +| `pixi-version` | The pixi version used | +| `cache-key` | The cache key (includes today's date) | +| `fallback-key` | The fallback cache key (yesterday's date) | + +#### `restore` + +| Input | Description | Required | +|-------|-------------|----------| +| `cache-key` | The cache key from `create-and-cache` | Yes | +| `fallback-key` | The fallback cache key from `create-and-cache` | Yes | + > [!NOTE] -> Using the same Pixi version in CI as from lockfile generation ensures better -> stability. Otherwise updates to Pixi which introduce breaking changes in: -> - (a) the format of the lock file - which would break your CI for the day, or -> - (b) the format of `pixi.toml` - which would break your CI until you fix it. +> The cache key includes the current date, so the lock file is regenerated daily. +> The fallback key handles edge cases where the restore job runs just after midnight. ## Why not commit the lock file? diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index dd46383..f07f4b7 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -12,8 +12,11 @@ outputs: description: "The pixi version used (for passing to downstream jobs)" value: ${{ inputs.pixi-version }} cache-key: - description: "The cache key used (for debugging)" + description: "The cache key used" value: ${{ steps.cache-key.outputs.key }} + fallback-key: + description: "The fallback cache key (yesterday's date)" + value: ${{ steps.cache-key.outputs.fallback-key }} runs: using: "composite" @@ -23,8 +26,10 @@ runs: shell: bash run: | today=$(date +'%Y-%m-%d') + yesterday=$(date -d 'yesterday' +'%Y-%m-%d' 2>/dev/null || date -v-1d +'%Y-%m-%d') base="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }}" echo "key=${base}_${today}" >> "$GITHUB_OUTPUT" + echo "fallback-key=${base}_${yesterday}" >> "$GITHUB_OUTPUT" - name: Restore pixi.lock from cache uses: actions/cache/restore@v5 diff --git a/restore/action.yml b/restore/action.yml index 1523951..13ffdd7 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -2,30 +2,22 @@ name: Restore Pixi Lock description: Restore a previously cached pixi.lock file. inputs: - pixi-version: - description: "Version of pixi used when creating the lock file (must match create-and-cache)" - required: false - default: "latest" + cache-key: + description: "The cache key from create-and-cache" + required: true + fallback-key: + description: "The fallback cache key from create-and-cache (for midnight edge cases)" + required: true runs: using: "composite" steps: - - name: Get cache key # fallback to yesterdays cache (in case of workflow runs at midnight) - id: cache-key - shell: bash - run: | - today=$(date +'%Y-%m-%d') - yesterday=$(date -d 'yesterday' +'%Y-%m-%d' 2>/dev/null || date -v-1d +'%Y-%m-%d') - base="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }}" - echo "key=${base}_${today}" >> "$GITHUB_OUTPUT" - echo "restore-key=${base}_${yesterday}" >> "$GITHUB_OUTPUT" - - name: Restore pixi.lock from cache uses: actions/cache/restore@v5 id: restore with: path: pixi.lock - key: ${{ steps.cache-key.outputs.key }} + key: ${{ inputs.cache-key }} restore-keys: | - ${{ steps.cache-key.outputs.restore-key }} + ${{ inputs.fallback-key }} fail-on-cache-miss: true From 9e70dd800790ca6a43120b5726c3cb0d764db63d Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:14:30 +0100 Subject: [PATCH 17/20] Calculate fallback key --- .github/workflows/test.yml | 2 -- README.md | 6 +----- create-and-cache/action.yml | 9 ++------- restore/action.yml | 17 +++++++++++++---- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7ac1d8..a2e9644 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,6 @@ jobs: runs-on: ubuntu-latest outputs: cache-key: ${{ steps.create-and-cache.outputs.cache-key }} - fallback-key: ${{ steps.create-and-cache.outputs.fallback-key }} pixi-version: ${{ steps.create-and-cache.outputs.pixi-version }} steps: - name: Checkout repository @@ -67,7 +66,6 @@ jobs: uses: ./pixi-lock/restore with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - fallback-key: ${{ needs.cache-pixi-lock.outputs.fallback-key }} - name: Verify pixi.lock exists shell: bash diff --git a/README.md b/README.md index 75ebb22..67875fb 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ jobs: runs-on: ubuntu-latest outputs: cache-key: ${{ steps.pixi-lock.outputs.cache-key }} - fallback-key: ${{ steps.pixi-lock.outputs.fallback-key }} pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} steps: - uses: actions/checkout@v4 @@ -39,7 +38,6 @@ jobs: - uses: Parcels-code/pixi-lock/restore@v1 with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - fallback-key: ${{ needs.cache-pixi-lock.outputs.fallback-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} @@ -58,18 +56,16 @@ jobs: |--------|-------------| | `pixi-version` | The pixi version used | | `cache-key` | The cache key (includes today's date) | -| `fallback-key` | The fallback cache key (yesterday's date) | #### `restore` | Input | Description | Required | |-------|-------------|----------| | `cache-key` | The cache key from `create-and-cache` | Yes | -| `fallback-key` | The fallback cache key from `create-and-cache` | Yes | > [!NOTE] > The cache key includes the current date, so the lock file is regenerated daily. -> The fallback key handles edge cases where the restore job runs just after midnight. +> The fallback key (yesterday's date) is calculated automatically to handle edge cases where the restore job runs just after midnight. ## Why not commit the lock file? diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index f07f4b7..7101270 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -14,9 +14,6 @@ outputs: cache-key: description: "The cache key used" value: ${{ steps.cache-key.outputs.key }} - fallback-key: - description: "The fallback cache key (yesterday's date)" - value: ${{ steps.cache-key.outputs.fallback-key }} runs: using: "composite" @@ -26,10 +23,8 @@ runs: shell: bash run: | today=$(date +'%Y-%m-%d') - yesterday=$(date -d 'yesterday' +'%Y-%m-%d' 2>/dev/null || date -v-1d +'%Y-%m-%d') - base="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }}" - echo "key=${base}_${today}" >> "$GITHUB_OUTPUT" - echo "fallback-key=${base}_${yesterday}" >> "$GITHUB_OUTPUT" + key="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles('pixi.toml') }}_${today}" + echo "key=${key}" >> "$GITHUB_OUTPUT" - name: Restore pixi.lock from cache uses: actions/cache/restore@v5 diff --git a/restore/action.yml b/restore/action.yml index 13ffdd7..7df2fca 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -5,13 +5,22 @@ inputs: cache-key: description: "The cache key from create-and-cache" required: true - fallback-key: - description: "The fallback cache key from create-and-cache (for midnight edge cases)" - required: true runs: using: "composite" steps: + - name: Calculate fallback key + id: fallback + shell: bash + run: | + cache_key="${{ inputs.cache-key }}" + # Extract base (everything before the last _) and date (after the last _) + base="${cache_key%_*}" + current_date="${cache_key##*_}" + # Calculate yesterday's date + 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: Restore pixi.lock from cache uses: actions/cache/restore@v5 id: restore @@ -19,5 +28,5 @@ runs: path: pixi.lock key: ${{ inputs.cache-key }} restore-keys: | - ${{ inputs.fallback-key }} + ${{ steps.fallback.outputs.key }} fail-on-cache-miss: true From fec275146a16881377956d23148e3b444fd3949c Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:38:09 +0100 Subject: [PATCH 18/20] Update README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 67875fb..c3783d7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,10 @@ This repo provides two GitHub Actions for managing `pixi.lock` files with cachin - **`create-and-cache`**: Generates a `pixi.lock` file and caches it - **`restore`**: Restores the cached `pixi.lock` file in downstream jobs -This two-action pattern is designed for CI workflows where you want to generate the lock file once and reuse it across multiple matrix jobs. +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 - +then shared across jobs). ## Usage From 6e094fa11ea6b0bdc0854aa8b379d9bcd33dc20e Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:44:03 +0100 Subject: [PATCH 19/20] Update readme --- .github/workflows/test.yml | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a2e9644..a54f64d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: exit 1 fi - test: + restore-and-install: needs: cache-pixi-lock runs-on: ${{ matrix.os }} strategy: @@ -80,7 +80,7 @@ jobs: - name: Setup pixi and install environment uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} - name: Verify environment installed shell: bash diff --git a/README.md b/README.md index c3783d7..a519c26 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ jobs: - uses: Parcels-code/pixi-lock/create-and-cache@v1 id: pixi-lock with: - pixi-version: v0.63.0 + pixi-version: ... # TODO: update with your selected pixi version ci: needs: cache-pixi-lock @@ -41,7 +41,7 @@ jobs: - uses: Parcels-code/pixi-lock/restore@v1 with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - - uses: prefix-dev/setup-pixi@v0.9.3 + - 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 From 2c33789fb2c19dc1fbc15669d2b1a10b62122e28 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:46:48 +0100 Subject: [PATCH 20/20] Add enableCrossOsArchive --- create-and-cache/action.yml | 1 + restore/action.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/create-and-cache/action.yml b/create-and-cache/action.yml index 7101270..04266f9 100644 --- a/create-and-cache/action.yml +++ b/create-and-cache/action.yml @@ -51,3 +51,4 @@ runs: with: path: pixi.lock key: ${{ steps.cache-key.outputs.key }} + enableCrossOsArchive: true diff --git a/restore/action.yml b/restore/action.yml index 7df2fca..79b27d6 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -27,6 +27,7 @@ runs: with: path: pixi.lock key: ${{ inputs.cache-key }} + enableCrossOsArchive: true restore-keys: | ${{ steps.fallback.outputs.key }} fail-on-cache-miss: true