1616 detect-skip-ci-trigger :
1717 name : " Detect CI Trigger: [skip-ci]"
1818 if : github.event_name == 'push' || github.event_name == 'pull_request'
19- runs-on : ubuntu-latest
19+ runs-on : ubuntu-slim
2020 outputs :
2121 triggered : ${{ steps.detect-trigger.outputs.trigger-found }}
2222 steps :
@@ -28,25 +28,46 @@ jobs:
2828 with :
2929 keyword : " [skip-ci]"
3030
31+ cache-pixi-lock :
32+ name : " Cache pixi lock"
33+ needs : detect-skip-ci-trigger
34+ runs-on : ubuntu-slim
35+ if : |
36+ always()
37+ && github.repository == 'xarray-contrib/pint-xarray'
38+ && (
39+ github.event_name == 'workflow_dispatch' || github.event_name == 'push'
40+ || (
41+ github.event_name == 'pull_request'
42+ && (
43+ needs.detect-skip-ci-trigger.outputs.triggered == 'false'
44+ && !contains(github.event.pull_request.labels.*.name, 'skip-ci')
45+ )
46+ )
47+ )
48+
49+ outputs :
50+ cache-key : ${{ steps.pixi-lock.outputs.cache-key }}
51+ pixi-version : ${{ steps.pixi-lock.outputs.pixi-version }}
52+ steps :
53+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
54+ with :
55+ persist-credentials : false
56+
57+ - uses : Parcels-code/pixi-lock/create-and-cache@5cbd7a155fa24aa0711ec0a9aad9ede0819e84a1 # v0.1.0
58+ id : pixi-lock
59+
3160 ci :
3261 name : ${{ matrix.os }} ${{ matrix.env }}
3362 runs-on : ${{ matrix.os }}
34- needs : detect-skip-ci-trigger
63+ needs : cache-pixi-lock
3564 defaults :
3665 run :
3766 shell : bash -l {0}
3867
3968 env :
4069 FORCE_COLOR : 3
4170
42- if : |
43- always()
44- && github.repository == 'xarray-contrib/pint-xarray'
45- && (
46- github.event_name == 'workflow_dispatch'
47- || needs.detect-skip-ci-trigger.outputs.triggered == 'false'
48- )
49-
5071 strategy :
5172 fail-fast : false
5273 matrix :
6081 # need to fetch all tags to get a correct version
6182 fetch-depth : 0 # fetch all branches and tags
6283
84+ - uses : Parcels-code/pixi-lock/restore@5cbd7a155fa24aa0711ec0a9aad9ede0819e84a1 # v0.1.0
85+ with :
86+ cache-key : ${{ needs.cache-pixi-lock.outputs.cache-key }}
87+
6388 - name : setup environment
6489 uses : prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # 0.9.4
6590 with :
91+ pixi-version : " ${{ needs.cache-pixi-lock.outputs.pixi-version }}"
92+ frozen : true
93+ cache : true
6694 environments : " ${{ matrix.env }}"
6795
6896 - name : investigate env variables
0 commit comments