1919jobs :
2020 detect-ci-trigger :
2121 name : detect ci trigger
22- runs-on : ubuntu-latest
22+ runs-on : ubuntu-slim
2323 if : |
2424 github.repository == 'pydata/xarray'
2525 && (github.event_name == 'push' || github.event_name == 'pull_request')
@@ -34,15 +34,31 @@ jobs:
3434 id : detect-trigger
3535 with :
3636 keyword : " [skip-ci]"
37+
3738 cache-pixi-lock :
38- uses : ./.github/workflows/cache-pixi-lock.yml
39- with :
40- pixi-version : " v0.63.2" # keep in sync with env var above
39+ needs : detect-ci-trigger
40+ if : needs.detect-ci-trigger.outputs.triggered == 'false'
41+ runs-on : ubuntu-latest
42+
43+ outputs :
44+ cache-key : ${{ steps.pixi-lock.outputs.cache-key }}
45+ pixi-version : ${{ steps.pixi-lock.outputs.pixi-version }}
46+
47+ steps :
48+ - uses : actions/checkout@v6
49+ - uses : Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
50+ id : pixi-lock
51+ with :
52+ pixi-version : ${{env.PIXI_VERSION}}
53+ - uses : actions/upload-artifact@v6
54+ with :
55+ name : pixi-lock
56+ path : pixi.lock
57+
4158 doctest :
4259 name : Doctests
4360 runs-on : " ubuntu-latest"
44- needs : [detect-ci-trigger, cache-pixi-lock]
45- if : needs.detect-ci-trigger.outputs.triggered == 'false'
61+ needs : cache-pixi-lock
4662
4763 defaults :
4864 run :
@@ -59,16 +75,12 @@ jobs:
5975 echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
6076
6177 - name : Restore cached pixi lockfile
62- uses : actions/cache/restore@v5
63- id : restore-pixi-lock
78+ uses : Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
6479 with :
65- enableCrossOsArchive : true
66- path : |
67- pixi.lock
68- key : ${{ needs.cache-pixi-lock.outputs.cache-id }}
80+ cache-key : ${{ needs.cache-pixi-lock.outputs.cache-key }}
6981 - uses : prefix-dev/setup-pixi@v0.9.4
7082 with :
71- pixi-version : ${{ env.PIXI_VERSION }}
83+ pixi-version : ${{ needs.cache-pixi-lock.outputs.pixi-version }}
7284 cache : true
7385 environments : ${{ env.PIXI_ENV }}
7486 cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
89101 mypy :
90102 name : Mypy
91103 runs-on : " ubuntu-latest"
92- needs : [detect-ci-trigger, cache-pixi-lock]
104+ needs : cache-pixi-lock
93105 defaults :
94106 run :
95107 shell : bash -l {0}
@@ -101,16 +113,12 @@ jobs:
101113 with :
102114 fetch-depth : 0 # Fetch all history for all branches and tags.
103115 - name : Restore cached pixi lockfile
104- uses : actions/cache/restore@v5
105- id : restore-pixi-lock
116+ uses : Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
106117 with :
107- enableCrossOsArchive : true
108- path : |
109- pixi.lock
110- key : ${{ needs.cache-pixi-lock.outputs.cache-id }}
118+ cache-key : ${{ needs.cache-pixi-lock.outputs.cache-key }}
111119 - uses : prefix-dev/setup-pixi@v0.9.4
112120 with :
113- pixi-version : ${{ env.PIXI_VERSION }}
121+ pixi-version : ${{ needs.cache-pixi-lock.outputs.pixi-version }}
114122 cache : true
115123 environments : ${{ env.PIXI_ENV }}
116124 cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
@@ -138,7 +146,7 @@ jobs:
138146 mypy-min :
139147 name : Mypy 3.11
140148 runs-on : " ubuntu-latest"
141- needs : [detect-ci-trigger, cache-pixi-lock]
149+ needs : cache-pixi-lock
142150 defaults :
143151 run :
144152 shell : bash -l {0}
@@ -150,16 +158,12 @@ jobs:
150158 with :
151159 fetch-depth : 0 # Fetch all history for all branches and tags.
152160 - name : Restore cached pixi lockfile
153- uses : actions/cache/restore@v5
154- id : restore-pixi-lock
161+ uses : Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
155162 with :
156- enableCrossOsArchive : true
157- path : |
158- pixi.lock
159- key : ${{ needs.cache-pixi-lock.outputs.cache-id }}
163+ cache-key : ${{ needs.cache-pixi-lock.outputs.cache-key }}
160164 - uses : prefix-dev/setup-pixi@v0.9.4
161165 with :
162- pixi-version : ${{ env.PIXI_VERSION }}
166+ pixi-version : ${{ needs.cache-pixi-lock.outputs.pixi-version }}
163167 cache : true
164168 environments : ${{ env.PIXI_ENV }}
165169 cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
@@ -187,7 +191,7 @@ jobs:
187191 pyright :
188192 name : Pyright | ${{ matrix.pixi-env }}"
189193 runs-on : " ubuntu-latest"
190- needs : [detect-ci-trigger, cache-pixi-lock]
194+ needs : cache-pixi-lock
191195 strategy :
192196 fail-fast : false
193197 matrix :
@@ -207,16 +211,12 @@ jobs:
207211 fetch-depth : 0 # Fetch all history for all branches and tags.
208212
209213 - name : Restore cached pixi lockfile
210- uses : actions/cache/restore@v5
211- id : restore-pixi-lock
214+ uses : Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
212215 with :
213- enableCrossOsArchive : true
214- path : |
215- pixi.lock
216- key : ${{ needs.cache-pixi-lock.outputs.cache-id }}
217- - uses : prefix-dev/setup-pixi@v0.9.4
216+ cache-key : ${{ needs.cache-pixi-lock.outputs.cache-key }}
217+ - uses : prefix-dev/setup-pixi@v0.9.3
218218 with :
219- pixi-version : ${{ env.PIXI_VERSION }}
219+ pixi-version : ${{ needs.cache-pixi-lock.outputs.pixi-version }}
220220 cache : true
221221 environments : ${{ matrix.pixi-env }}
222222 cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
@@ -244,8 +244,8 @@ jobs:
244244 min-version-policy :
245245 name : Minimum Version Policy
246246 runs-on : " ubuntu-latest"
247- needs : [detect-ci-trigger, cache-pixi-lock]
248- if : needs.detect-ci-trigger.outputs.triggered == 'false'
247+ needs : cache-pixi-lock
248+
249249 defaults :
250250 run :
251251 shell : bash -l {0}
@@ -259,17 +259,13 @@ jobs:
259259 fetch-depth : 0 # Fetch all history for all branches and tags.
260260
261261 - name : Restore cached pixi lockfile
262- uses : actions/cache/restore@v5
263- id : restore-pixi-lock
262+ uses : Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
264263 with :
265- enableCrossOsArchive : true
266- path : |
267- pixi.lock
268- key : ${{ needs.cache-pixi-lock.outputs.cache-id }}
264+ cache-key : ${{ needs.cache-pixi-lock.outputs.cache-key }}
269265
270266 - uses : prefix-dev/setup-pixi@v0.9.4
271267 with :
272- pixi-version : ${{ env.PIXI_VERSION }}
268+ pixi-version : ${{ needs.cache-pixi-lock.outputs.pixi-version }}
273269 cache : true
274270 environments : " policy"
275271 cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
0 commit comments