Skip to content

Commit d90bb91

Browse files
authored
Merge branch 'main' into async-dtreec
2 parents 68ae087 + 65c5df3 commit d90bb91

17 files changed

Lines changed: 161 additions & 169 deletions

File tree

.github/workflows/cache-pixi-lock.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/ci-additional.yaml

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
jobs:
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' }}
@@ -89,7 +101,7 @@ jobs:
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' }}

.github/workflows/ci.yaml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
jobs:
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')
@@ -36,14 +36,30 @@ jobs:
3636
keyword: "[skip-ci]"
3737

3838
cache-pixi-lock:
39-
uses: ./.github/workflows/cache-pixi-lock.yml
40-
with:
41-
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+
42+
runs-on: ubuntu-latest
43+
44+
outputs:
45+
cache-key: ${{ steps.pixi-lock.outputs.cache-key }}
46+
pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }}
47+
48+
steps:
49+
- uses: actions/checkout@v6
50+
- uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
51+
id: pixi-lock
52+
with:
53+
pixi-version: ${{env.PIXI_VERSION}}
54+
- uses: actions/upload-artifact@v6
55+
with:
56+
name: pixi-lock
57+
path: pixi.lock
58+
4259
test:
4360
name: "${{ matrix.os }} | ${{ matrix.pixi-env }}${{ matrix.pytest-addopts && format(' ({0})', matrix.pytest-addopts) || '' }}"
4461
runs-on: ${{ matrix.os }}
45-
needs: [detect-ci-trigger, cache-pixi-lock]
46-
if: needs.detect-ci-trigger.outputs.triggered == 'false'
62+
needs: cache-pixi-lock
4763
defaults:
4864
run:
4965
shell: bash -l {0}
@@ -84,16 +100,12 @@ jobs:
84100
with:
85101
fetch-depth: 0 # Fetch all history for all branches and tags.
86102
- name: Restore cached pixi lockfile
87-
uses: actions/cache/restore@v5
88-
id: restore-pixi-lock
103+
uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
89104
with:
90-
enableCrossOsArchive: true
91-
path: |
92-
pixi.lock
93-
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
94-
- uses: prefix-dev/setup-pixi@v0.9.4
105+
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
106+
- uses: prefix-dev/setup-pixi@v0.9.3
95107
with:
96-
pixi-version: ${{ env.PIXI_VERSION }}
108+
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
97109
cache: true
98110
environments: ${{ matrix.pixi-env }}
99111
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
@@ -170,7 +182,7 @@ jobs:
170182

171183
event_file:
172184
name: "Event File"
173-
runs-on: ubuntu-latest
185+
runs-on: ubuntu-slim
174186
if: github.repository == 'pydata/xarray'
175187
steps:
176188
- name: Upload

.github/workflows/hypothesis.yaml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
if: |
2323
github.repository == 'pydata/xarray'
24-
&& (github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule')
24+
&& github.event_name == 'pull_request'
2525
&& !contains(github.event.pull_request.labels.*.name, 'skip-ci')
2626
outputs:
2727
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
@@ -35,21 +35,39 @@ jobs:
3535
keyword: "[skip-ci]"
3636

3737
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
41-
42-
hypothesis:
43-
name: Slow Hypothesis Tests
44-
runs-on: "ubuntu-latest"
45-
needs: [detect-ci-trigger, cache-pixi-lock]
38+
needs: detect-ci-trigger
4639
if: |
4740
always()
4841
&& (
49-
needs.detect-ci-trigger.outputs.triggered == 'false'
50-
&& ( (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
51-
|| contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis'))
42+
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
43+
|| (
44+
github.event_name == 'pull_request'
45+
&& needs.detect-ci-trigger.outputs.triggered == 'false'
46+
&& contains(github.event.pull_request.labels.*.name, 'run-slow-hypothesis')
47+
)
5248
)
49+
50+
runs-on: ubuntu-latest
51+
outputs:
52+
cache-key: ${{ steps.pixi-lock.outputs.cache-key }}
53+
pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }}
54+
steps:
55+
- uses: actions/checkout@v6
56+
- uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
57+
id: pixi-lock
58+
with:
59+
pixi-version: ${{env.PIXI_VERSION}}
60+
- uses: actions/upload-artifact@v6
61+
with:
62+
name: pixi-lock
63+
path: pixi.lock
64+
65+
hypothesis:
66+
name: Slow Hypothesis Tests
67+
runs-on: "ubuntu-latest"
68+
69+
needs: cache-pixi-lock
70+
5371
defaults:
5472
run:
5573
shell: bash -l {0}
@@ -63,16 +81,12 @@ jobs:
6381
fetch-depth: 0 # Fetch all history for all branches and tags.
6482

6583
- name: Restore cached pixi lockfile
66-
uses: actions/cache/restore@v5
67-
id: restore-pixi-lock
84+
uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
6885
with:
69-
enableCrossOsArchive: true
70-
path: |
71-
pixi.lock
72-
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
73-
- uses: prefix-dev/setup-pixi@v0.9.4
86+
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
87+
- uses: prefix-dev/setup-pixi@v0.9.3
7488
with:
75-
pixi-version: ${{ env.PIXI_VERSION }}
89+
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
7690
cache: true
7791
environments: ${{ env.PIXI_ENV }}
7892
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}

0 commit comments

Comments
 (0)