Skip to content

Commit 0ae3d03

Browse files
committed
Add should-skip-ci step in ci.yaml
1 parent 3025125 commit 0ae3d03

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,32 @@ env:
2020
PIXI_VERSION: "v0.63.0"
2121

2222
jobs:
23+
should-skip-ci:
24+
name: should skip ci
25+
runs-on: ubuntu-latest
26+
if: |
27+
github.repository == 'Parcels-code/Parcels'
28+
&& (github.event_name == 'push' || github.event_name == 'pull_request')
29+
outputs:
30+
value: ${{ steps.check-skip.outputs.trigger-found == 'true' || contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
31+
steps:
32+
- uses: actions/checkout@v5
33+
with:
34+
fetch-depth: 2
35+
- uses: xarray-contrib/ci-trigger@v1
36+
id: check-skip
37+
with:
38+
keyword: "[skip-ci]"
39+
2340
cache-pixi-lock:
2441
uses: ./.github/workflows/cache-pixi-lock.yml
2542
with:
2643
pixi-version: "v0.62.2" # keep in sync with env var above
2744
unit-test:
2845
name: "Unit tests: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests"
2946
runs-on: ${{ matrix.os }}-latest
30-
needs: [cache-pixi-lock]
47+
needs: [should-skip-ci, cache-pixi-lock]
48+
if: needs.should-skip-ci.outputs.value == 'false'
3149
env:
3250
COVERAGE_REPORT: "${{ matrix.os }}_${{ matrix.pixi-environment }}_unit_test_report.html"
3351
strategy:
@@ -91,11 +109,12 @@ jobs:
91109
name: Unittest report ${{ matrix.os }}-${{ matrix.pixi-environment }}
92110
path: ${{ env.COVERAGE_REPORT }}
93111
integration-test:
94-
# TODO v4: Re-enable the workflow once development has stabilized and we want to run integration tests again
95-
if: false
96112
name: "Integration: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests-notebooks"
97113
runs-on: ${{ matrix.os }}-latest
98-
needs: [cache-pixi-lock]
114+
needs: [should-skip-ci, cache-pixi-lock]
115+
# TODO v4: Re-enable the workflow once development has stabilized and we want to run integration tests again
116+
# needs.should-skip-ci.outputs.value == 'false'
117+
if: false
99118
env:
100119
COVERAGE_REPORT: "${{ matrix.os }}_${{ matrix.pixi-environment }}_integration_test_report.html"
101120
strategy:
@@ -150,10 +169,11 @@ jobs:
150169
pattern: "* report *"
151170
typechecking:
152171
name: "TypeChecking: pixi run typing"
172+
runs-on: ubuntu-latest
173+
needs: [should-skip-ci, cache-pixi-lock]
153174
# TODO v4: Enable typechecking again
175+
# needs.should-skip-ci.outputs.value == 'false'
154176
if: false
155-
runs-on: ubuntu-latest
156-
needs: [cache-pixi-lock]
157177
steps:
158178
- name: Checkout
159179
uses: actions/checkout@v5

0 commit comments

Comments
 (0)