Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/cache-pixi-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,41 @@ on:

jobs:
cache-pixi-lock:
name: Generate output
name: Pixi lock
runs-on: ubuntu-latest
outputs:
cache-id: ${{ steps.restore.outputs.cache-primary-key }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@v4
- uses: actions/cache/restore@v5
id: restore
with:
path: |
pixi.lock
key: ${{ steps.date.outputs.date }}_${{inputs.pixi-version}}_${{hashFiles('pixi.toml')}}
- uses: prefix-dev/[email protected].0
key: ${{ steps.date.outputs.date }}_${{ inputs.pixi-version }}_${{hashFiles('pixi.toml')}}
- uses: prefix-dev/[email protected].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 }}
run: pixi lock
- uses: actions/cache/save@v4
- uses: actions/cache/save@v5
if: ${{ !steps.restore.outputs.cache-hit }}
id: cache
with:
path: |
pixi.lock
key: ${{ steps.restore.outputs.cache-primary-key }}
- name: Upload pixi.lock
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: pixi-lock
path: pixi.lock
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ defaults:
run:
shell: bash -el {0}

env:
PIXI_VERSION: "v0.63.0"

jobs:
cache-pixi-lock:
uses: ./.github/workflows/cache-pixi-lock.yml
with:
pixi-version: "v0.62.2" # keep in sync with env var above
Comment on lines +25 to +26
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wart in the code "keep in sync with above" is unfortunately necessary. Discussion about this and pinning of pixi versions in CI can be seen at pydata/xarray#10888 (comment)

unit-test:
name: "Unit tests: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests"
runs-on: ${{ matrix.os }}-latest
Expand Down Expand Up @@ -49,6 +54,7 @@ jobs:
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/[email protected]
with:
pixi-version: ${{ env.PIXI_VERSION }}
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
Expand Down Expand Up @@ -112,6 +118,7 @@ jobs:
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/[email protected]
with:
pixi-version: ${{ env.PIXI_VERSION }}
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
- name: Integration test
Expand Down Expand Up @@ -159,6 +166,7 @@ jobs:
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/[email protected]
with:
pixi-version: ${{ env.PIXI_VERSION }}
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
- name: Typechecking
Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "dynamic" # dynamic versioning needs better support in pixi https://gi
license = "MIT" # can remove this once https://github.com/prefix-dev/pixi-build-backends/issues/397 is resolved

[package.build]
backend = { name = "pixi-build-python", version = "==0.4.0" }
backend = { name = "pixi-build-python", version = "0.4.*" }

[package.host-dependencies]
setuptools = "*"
Expand Down
Loading