Skip to content

Commit 31c7bbb

Browse files
committed
Update cache-pixi-lock workflow to recurse submodules
1 parent cdfe1e6 commit 31c7bbb

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Adapted from https://raw.githubusercontent.com/Parcels-code/Parcels/58cdd6185b3af03785c567914a070288ffd804e0/.github/workflows/cache-pixi-lock.yml
2+
name: Generate and cache Pixi lockfile
3+
4+
on:
5+
workflow_call:
6+
outputs:
7+
cache-id:
8+
description: "The lock file contents"
9+
value: ${{ jobs.cache-pixi-lock.outputs.cache-id }}
10+
11+
jobs:
12+
cache-pixi-lock:
13+
name: Generate output
14+
runs-on: ubuntu-latest
15+
outputs:
16+
cache-id: ${{ steps.restore.outputs.cache-primary-key }}
17+
steps:
18+
- uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
21+
submodules: recursive
22+
- name: Get current date
23+
id: date
24+
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
25+
- uses: actions/cache/restore@v4
26+
id: restore
27+
with:
28+
path: |
29+
pixi.lock
30+
key: ${{ steps.date.outputs.date }}_${{hashFiles('pixi.toml')}}
31+
- uses: prefix-dev/[email protected]
32+
if: ${{ !steps.restore.outputs.cache-hit }}
33+
with:
34+
pixi-version: v0.56.0
35+
run-install: false
36+
- name: Run pixi lock
37+
if: ${{ !steps.restore.outputs.cache-hit }}
38+
run: pixi lock
39+
- uses: actions/cache/save@v4
40+
if: ${{ !steps.restore.outputs.cache-hit }}
41+
id: cache
42+
with:
43+
path: |
44+
pixi.lock
45+
key: ${{ steps.restore.outputs.cache-primary-key }}
46+
- name: Upload pixi.lock
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: pixi-lock
50+
path: pixi.lock

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222

2323
jobs:
2424
cache-pixi-lock:
25-
uses: Parcels-code/Parcels/.github/workflows/cache-pixi-lock.yml@58cdd6185b3af03785c567914a070288ffd804e0
25+
uses: ./.github/workflows/cache-pixi-lock.yml
2626

2727
tests:
2828
name: "Unit tests: ${{ matrix.runs-on }} | pixi run -e ${{ matrix.pixi-environment }} tests"

0 commit comments

Comments
 (0)