From 334873218cd211fa1e6f67e5868b68a38d44a9b7 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:23:31 +0100 Subject: [PATCH 01/12] Refactor `cache-pixi-lock.yml` workflow into external action Followup on https://github.com/pydata/xarray/pull/10888#discussion_r2556281039 --- .github/workflows/cache-pixi-lock.yml | 52 ----------------------- .github/workflows/ci-additional.yaml | 57 ++++++++++++-------------- .github/workflows/ci.yaml | 27 +++++++----- .github/workflows/hypothesis.yaml | 27 +++++++----- .github/workflows/upstream-dev-ci.yaml | 37 +++++++++-------- 5 files changed, 80 insertions(+), 120 deletions(-) delete mode 100644 .github/workflows/cache-pixi-lock.yml diff --git a/.github/workflows/cache-pixi-lock.yml b/.github/workflows/cache-pixi-lock.yml deleted file mode 100644 index e938a7664dd..00000000000 --- a/.github/workflows/cache-pixi-lock.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Generate and cache Pixi lockfile - -on: - workflow_call: - inputs: - pixi-version: - type: string - outputs: - cache-id: - description: "The lock file contents" - value: ${{ jobs.cache-pixi-lock.outputs.cache-id }} - -jobs: - cache-pixi-lock: - name: Pixi lock - runs-on: ubuntu-latest - outputs: - cache-id: ${{ steps.restore.outputs.cache-primary-key }} - steps: - - 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@v5 - id: restore - with: - path: | - pixi.lock - key: ${{ steps.date.outputs.date }}_${{ inputs.pixi-version }}_${{hashFiles('pixi.toml')}} - - 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 }} - run: pixi lock - - 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@v6 - with: - name: pixi-lock - path: pixi.lock diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index ee21bf6f559..e2af317324e 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -35,9 +35,20 @@ jobs: with: keyword: "[skip-ci]" cache-pixi-lock: - uses: ./.github/workflows/cache-pixi-lock.yml - with: - pixi-version: "v0.63.1" # keep in sync with env var above + runs-on: ubuntu-slim + outputs: + cache-key: ${{ steps.pixi-lock.outputs.cache-key }} + pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} + steps: + - uses: actions/checkout@v6 + - uses: Parcels-code/pixi-lock/create-and-cache@82087290114bffa037dc527b2afc3d1c797eda8f + id: pixi-lock + with: + pixi-version: ${{env.PIXI_VERSION}} + - uses: actions/upload-artifact@v6 + with: + name: pixi-lock + path: pixi.lock doctest: name: Doctests runs-on: "ubuntu-latest" @@ -59,16 +70,12 @@ jobs: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: ${{ env.PIXI_ENV }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} @@ -101,16 +108,12 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: ${{ env.PIXI_ENV }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} @@ -150,16 +153,12 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: ${{ env.PIXI_ENV }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} @@ -207,16 +206,12 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: ${{ matrix.pixi-env }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 94d46b42def..89b7e1f1c14 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,9 +36,20 @@ jobs: keyword: "[skip-ci]" cache-pixi-lock: - uses: ./.github/workflows/cache-pixi-lock.yml - with: - pixi-version: "v0.63.1" # keep in sync with env var above + runs-on: ubuntu-slim + outputs: + cache-key: ${{ steps.pixi-lock.outputs.cache-key }} + pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} + steps: + - uses: actions/checkout@v6 + - uses: Parcels-code/pixi-lock/create-and-cache@82087290114bffa037dc527b2afc3d1c797eda8f + id: pixi-lock + with: + pixi-version: ${{env.PIXI_VERSION}} + - uses: actions/upload-artifact@v6 + with: + name: pixi-lock + path: pixi.lock test: name: "${{ matrix.os }} | ${{ matrix.pixi-env }}${{ matrix.pytest-addopts && format(' ({0})', matrix.pytest-addopts) || '' }}" runs-on: ${{ matrix.os }} @@ -84,16 +95,12 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: ${{ matrix.pixi-env }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index b817937a8bc..9a5fb07f205 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -35,9 +35,20 @@ jobs: keyword: "[skip-ci]" cache-pixi-lock: - uses: ./.github/workflows/cache-pixi-lock.yml - with: - pixi-version: "v0.63.1" # keep in sync with env var above + runs-on: ubuntu-slim + outputs: + cache-key: ${{ steps.pixi-lock.outputs.cache-key }} + pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} + steps: + - uses: actions/checkout@v6 + - uses: Parcels-code/pixi-lock/create-and-cache@82087290114bffa037dc527b2afc3d1c797eda8f + id: pixi-lock + with: + pixi-version: ${{env.PIXI_VERSION}} + - uses: actions/upload-artifact@v6 + with: + name: pixi-lock + path: pixi.lock hypothesis: name: Slow Hypothesis Tests @@ -63,16 +74,12 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: ${{ env.PIXI_ENV }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 28ba8b56863..be5ea8337f7 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -38,9 +38,20 @@ jobs: with: keyword: "[test-upstream]" cache-pixi-lock: - uses: ./.github/workflows/cache-pixi-lock.yml - with: - pixi-version: "v0.63.1" # keep in sync with env var above + runs-on: ubuntu-slim + outputs: + cache-key: ${{ steps.pixi-lock.outputs.cache-key }} + pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} + steps: + - uses: actions/checkout@v6 + - uses: Parcels-code/pixi-lock/create-and-cache@82087290114bffa037dc527b2afc3d1c797eda8f + id: pixi-lock + with: + pixi-version: ${{env.PIXI_VERSION}} + - uses: actions/upload-artifact@v6 + with: + name: pixi-lock + path: pixi.lock upstream-dev: name: upstream-dev runs-on: ubuntu-latest @@ -64,16 +75,12 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: ${{ matrix.pixi-env }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} @@ -121,16 +128,12 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: ${{ matrix.pixi-env }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} From 1190e96a43cf4d979e89a076cc942c43ca443b0f Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 21 Jan 2026 22:54:14 +0100 Subject: [PATCH 02/12] update min-version-policy workflow as well --- .github/workflows/ci-additional.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index e2af317324e..42dea503076 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -254,17 +254,13 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: actions/cache/restore@v5 - id: restore-pixi-lock + uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f with: - enableCrossOsArchive: true - path: | - pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 with: - pixi-version: ${{ env.PIXI_VERSION }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache: true environments: "policy" cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} From 1bf84030f42ba8d81b71d30329d0676879948aca Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:35:11 +0100 Subject: [PATCH 03/12] Update version --- .github/workflows/ci-additional.yaml | 12 ++++++------ .github/workflows/ci.yaml | 4 ++-- .github/workflows/hypothesis.yaml | 4 ++-- .github/workflows/upstream-dev-ci.yaml | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 42dea503076..c707ac9059d 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -41,7 +41,7 @@ jobs: pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} steps: - uses: actions/checkout@v6 - - uses: Parcels-code/pixi-lock/create-and-cache@82087290114bffa037dc527b2afc3d1c797eda8f + - uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b id: pixi-lock with: pixi-version: ${{env.PIXI_VERSION}} @@ -70,7 +70,7 @@ jobs: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 @@ -108,7 +108,7 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 @@ -153,7 +153,7 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 @@ -206,7 +206,7 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 @@ -254,7 +254,7 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 89b7e1f1c14..11984f36009 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,7 +42,7 @@ jobs: pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} steps: - uses: actions/checkout@v6 - - uses: Parcels-code/pixi-lock/create-and-cache@82087290114bffa037dc527b2afc3d1c797eda8f + - uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b id: pixi-lock with: pixi-version: ${{env.PIXI_VERSION}} @@ -95,7 +95,7 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index 9a5fb07f205..2783026c2a8 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -41,7 +41,7 @@ jobs: pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} steps: - uses: actions/checkout@v6 - - uses: Parcels-code/pixi-lock/create-and-cache@82087290114bffa037dc527b2afc3d1c797eda8f + - uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b id: pixi-lock with: pixi-version: ${{env.PIXI_VERSION}} @@ -74,7 +74,7 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index be5ea8337f7..c47171e0ec4 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -44,7 +44,7 @@ jobs: pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} steps: - uses: actions/checkout@v6 - - uses: Parcels-code/pixi-lock/create-and-cache@82087290114bffa037dc527b2afc3d1c797eda8f + - uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b id: pixi-lock with: pixi-version: ${{env.PIXI_VERSION}} @@ -75,7 +75,7 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 @@ -128,7 +128,7 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Restore cached pixi lockfile - uses: Parcels-code/pixi-lock/restore@82087290114bffa037dc527b2afc3d1c797eda8f + uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} - uses: prefix-dev/setup-pixi@v0.9.3 From d3722b41801420f30fa61cdc0ff212b07da161d0 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 5 Feb 2026 23:44:03 +0100 Subject: [PATCH 04/12] use `ubuntu-slim` to detect commit message tags --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 11984f36009..515b05e7d6f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ env: jobs: detect-ci-trigger: name: detect ci trigger - runs-on: ubuntu-latest + runs-on: ubuntu-slim if: | github.repository == 'pydata/xarray' && (github.event_name == 'push' || github.event_name == 'pull_request') From fb82d604c894f0c40e15b6ff07e30bcdded5854f Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 5 Feb 2026 23:46:17 +0100 Subject: [PATCH 05/12] have the cache creation workflow depend on the trigger --- .github/workflows/ci.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 515b05e7d6f..28fed31db10 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,10 +36,15 @@ jobs: keyword: "[skip-ci]" cache-pixi-lock: + needs: detect-ci-trigger + if: needs.detect-ci-trigger.outputs.triggered == 'false' + runs-on: ubuntu-slim + outputs: cache-key: ${{ steps.pixi-lock.outputs.cache-key }} pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} + steps: - uses: actions/checkout@v6 - uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b @@ -50,11 +55,11 @@ jobs: with: name: pixi-lock path: pixi.lock + test: name: "${{ matrix.os }} | ${{ matrix.pixi-env }}${{ matrix.pytest-addopts && format(' ({0})', matrix.pytest-addopts) || '' }}" runs-on: ${{ matrix.os }} - needs: [detect-ci-trigger, cache-pixi-lock] - if: needs.detect-ci-trigger.outputs.triggered == 'false' + needs: cache-pixi-lock defaults: run: shell: bash -l {0} From 0003e4828f6bb590c2433f6e62fa78c976f9254d Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 5 Feb 2026 23:47:01 +0100 Subject: [PATCH 06/12] more switching to `ubuntu-slim` --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 28fed31db10..30a5b864962 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -182,7 +182,7 @@ jobs: event_file: name: "Event File" - runs-on: ubuntu-latest + runs-on: ubuntu-slim if: github.repository == 'pydata/xarray' steps: - name: Upload From 95bb2fb131504ac7e0ad604c92d840bfa38f07aa Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 5 Feb 2026 23:57:01 +0100 Subject: [PATCH 07/12] simplify the job dependencies --- .github/workflows/ci-additional.yaml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index c707ac9059d..77aa0a4263d 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -19,7 +19,7 @@ env: jobs: detect-ci-trigger: name: detect ci trigger - runs-on: ubuntu-latest + runs-on: ubuntu-slim if: | github.repository == 'pydata/xarray' && (github.event_name == 'push' || github.event_name == 'pull_request') @@ -34,11 +34,16 @@ jobs: id: detect-trigger with: keyword: "[skip-ci]" + cache-pixi-lock: + needs: detect-ci-trigger + if: needs.detect-ci-trigger.outputs.triggered == 'false' runs-on: ubuntu-slim + outputs: cache-key: ${{ steps.pixi-lock.outputs.cache-key }} pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} + steps: - uses: actions/checkout@v6 - uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b @@ -49,11 +54,11 @@ jobs: with: name: pixi-lock path: pixi.lock + doctest: name: Doctests runs-on: "ubuntu-latest" - needs: [detect-ci-trigger, cache-pixi-lock] - if: needs.detect-ci-trigger.outputs.triggered == 'false' + needs: cache-pixi-lock defaults: run: @@ -96,7 +101,7 @@ jobs: mypy: name: Mypy runs-on: "ubuntu-latest" - needs: [detect-ci-trigger, cache-pixi-lock] + needs: cache-pixi-lock defaults: run: shell: bash -l {0} @@ -141,7 +146,7 @@ jobs: mypy-min: name: Mypy 3.11 runs-on: "ubuntu-latest" - needs: [detect-ci-trigger, cache-pixi-lock] + needs: cache-pixi-lock defaults: run: shell: bash -l {0} @@ -186,7 +191,7 @@ jobs: pyright: name: Pyright | ${{ matrix.pixi-env }}" runs-on: "ubuntu-latest" - needs: [detect-ci-trigger, cache-pixi-lock] + needs: cache-pixi-lock strategy: fail-fast: false matrix: @@ -239,8 +244,8 @@ jobs: min-version-policy: name: Minimum Version Policy runs-on: "ubuntu-latest" - needs: [detect-ci-trigger, cache-pixi-lock] - if: needs.detect-ci-trigger.outputs.triggered == 'false' + needs: cache-pixi-lock + defaults: run: shell: bash -l {0} From 9295f728c43c4315b2184165df0702c83199f086 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 5 Feb 2026 23:57:29 +0100 Subject: [PATCH 08/12] simplify the trigger conditions of the hypothesis workflow --- .github/workflows/hypothesis.yaml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index 2783026c2a8..da92d13053c 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: | github.repository == 'pydata/xarray' - && (github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule') + && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') outputs: triggered: ${{ steps.detect-trigger.outputs.trigger-found }} @@ -35,6 +35,18 @@ jobs: keyword: "[skip-ci]" cache-pixi-lock: + needs: detect-ci-trigger + if: | + always() + && ( + ( + github.event_name == 'pull_request' + && needs.detect-ci-trigger.outputs.triggered == 'false' + && !contains(github.event.pull_request.labels.*.name, 'run-slow-hypothesis') + ) + || (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') + ) + runs-on: ubuntu-slim outputs: cache-key: ${{ steps.pixi-lock.outputs.cache-key }} @@ -53,14 +65,9 @@ jobs: hypothesis: name: Slow Hypothesis Tests runs-on: "ubuntu-latest" - needs: [detect-ci-trigger, cache-pixi-lock] - if: | - always() - && ( - needs.detect-ci-trigger.outputs.triggered == 'false' - && ( (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') - || contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis')) - ) + + needs: cache-pixi-lock + defaults: run: shell: bash -l {0} From 588d2dc6eb3c44a9acc142f5bffa9ca6bbae019f Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 6 Feb 2026 00:01:01 +0100 Subject: [PATCH 09/12] simplify the dependencies and conditions of the upstream-dev job --- .github/workflows/upstream-dev-ci.yaml | 28 +++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index c47171e0ec4..f15ad5fc9e4 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -22,7 +22,7 @@ env: jobs: detect-ci-trigger: name: detect upstream-dev ci trigger - runs-on: ubuntu-latest + runs-on: ubuntu-slim if: | github.repository == 'pydata/xarray' && (github.event_name == 'push' || github.event_name == 'pull_request') @@ -37,8 +37,24 @@ jobs: id: detect-trigger with: keyword: "[test-upstream]" + cache-pixi-lock: runs-on: ubuntu-slim + needs: detect-ci-trigger + if: | + always() + && github.repository == 'pydata/xarray' + && ( + (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') + || ( + github.event_name == 'pull_request' + && ( + needs.detect-ci-trigger.outputs.triggered == 'true' + || contains( github.event.pull_request.labels.*.name, 'run-upstream') + ) + ) + ) + outputs: cache-key: ${{ steps.pixi-lock.outputs.cache-key }} pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} @@ -52,17 +68,11 @@ jobs: with: name: pixi-lock path: pixi.lock + upstream-dev: name: upstream-dev runs-on: ubuntu-latest - needs: [detect-ci-trigger, cache-pixi-lock] - if: | - always() - && ( - (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') - || needs.detect-ci-trigger.outputs.triggered == 'true' - || contains( github.event.pull_request.labels.*.name, 'run-upstream') - ) + needs: cache-pixi-lock defaults: run: shell: bash -l {0} From bca277181ae6b862e175d8bada0915e40f99c927 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 6 Feb 2026 00:13:50 +0100 Subject: [PATCH 10/12] skip the hypothesis job unless tag set and no trigger --- .github/workflows/hypothesis.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index 0ba90276d09..f0e00cb885d 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -39,12 +39,12 @@ jobs: if: | always() && ( - ( + (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') + || ( github.event_name == 'pull_request' && needs.detect-ci-trigger.outputs.triggered == 'false' - && !contains(github.event.pull_request.labels.*.name, 'run-slow-hypothesis') + && contains(github.event.pull_request.labels.*.name, 'run-slow-hypothesis') ) - || (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') ) runs-on: ubuntu-slim From fccb64f5293bd15b13a46f17501e7eecebe734b6 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 6 Feb 2026 00:14:50 +0100 Subject: [PATCH 11/12] [skip-ci] From 9d2968a16c48be98a30530781e65bd5a2ee54f32 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 6 Feb 2026 00:20:05 +0100 Subject: [PATCH 12/12] trigger again