Skip to content
Open
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
52 changes: 0 additions & 52 deletions .github/workflows/cache-pixi-lock.yml

This file was deleted.

90 changes: 43 additions & 47 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -34,15 +34,31 @@ jobs:
id: detect-trigger
with:
keyword: "[skip-ci]"

cache-pixi-lock:
uses: ./.github/workflows/cache-pixi-lock.yml
with:
pixi-version: "v0.63.2" # keep in sync with env var above
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
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"
needs: [detect-ci-trigger, cache-pixi-lock]
if: needs.detect-ci-trigger.outputs.triggered == 'false'
needs: cache-pixi-lock

defaults:
run:
Expand All @@ -59,16 +75,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@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
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.4
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' }}
Expand All @@ -89,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}
Expand All @@ -101,16 +113,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@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
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.4
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' }}
Expand Down Expand Up @@ -138,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}
Expand All @@ -150,16 +158,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@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
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.4
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' }}
Expand Down Expand Up @@ -187,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:
Expand All @@ -207,16 +211,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@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
with:
enableCrossOsArchive: true
path: |
pixi.lock
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/setup-pixi@v0.9.4
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' }}
Expand Down Expand Up @@ -244,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}
Expand All @@ -259,17 +259,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@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
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.4
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' }}
Expand Down
42 changes: 27 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -36,14 +36,30 @@ jobs:
keyword: "[skip-ci]"

cache-pixi-lock:
uses: ./.github/workflows/cache-pixi-lock.yml
with:
pixi-version: "v0.63.2" # keep in sync with env var above
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
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 }}
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}
Expand Down Expand Up @@ -84,16 +100,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@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
with:
enableCrossOsArchive: true
path: |
pixi.lock
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/setup-pixi@v0.9.4
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' }}
Expand Down Expand Up @@ -170,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
Expand Down
54 changes: 34 additions & 20 deletions .github/workflows/hypothesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -35,21 +35,39 @@ jobs:
keyword: "[skip-ci]"

cache-pixi-lock:
uses: ./.github/workflows/cache-pixi-lock.yml
with:
pixi-version: "v0.63.2" # keep in sync with env var above

hypothesis:
name: Slow Hypothesis Tests
runs-on: "ubuntu-latest"
needs: [detect-ci-trigger, cache-pixi-lock]
needs: detect-ci-trigger
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'))
(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')
)
)

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
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
runs-on: "ubuntu-latest"

needs: cache-pixi-lock

defaults:
run:
shell: bash -l {0}
Expand All @@ -63,16 +81,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@9a2866f8258b87a3c616d5ad7d51c6cd853df78b
with:
enableCrossOsArchive: true
path: |
pixi.lock
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/setup-pixi@v0.9.4
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' }}
Expand Down
Loading
Loading