11name : backend
22
3- on : [workflow_call]
3+ on :
4+ pull_request :
5+ push :
6+ branches :
7+ - main
8+ merge_group :
9+ types : [checks_requested]
10+
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : true
14+
15+ permissions : {}
416
517defaults :
618 run :
719 shell : " bash"
820
921jobs :
22+ backend-changes :
23+ runs-on : ubuntu-latest
24+ outputs :
25+ changes : ${{ steps.filter.outputs.backend }}
26+ permissions :
27+ pull-requests : read
28+ steps :
29+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+ - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
31+ id : filter
32+ with :
33+ filters : |
34+ backend:
35+ - '.github/workflows/backend.yml'
36+ - 'skore/**'
37+
1038 backend-lint :
1139 runs-on : " ubuntu-latest"
40+ needs : [backend-changes]
41+ if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) && needs.backend-changes.outputs.changes == 'true') }}
42+ permissions :
43+ contents : read
1244 steps :
1345 - name : Checkout code
1446 uses : actions/checkout@v4
3062
3163 backend-lockfiles :
3264 runs-on : " ubuntu-latest"
33- if : ${{ github.event_name == 'pull_request' }}
65+ needs : [backend-changes]
66+ if : ${{ (contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) && needs.backend-changes.outputs.changes == 'true') }}
67+ permissions :
68+ contents : read
3469 steps :
3570 - name : Checkout code
3671 uses : actions/checkout@v4
5085 fi
5186
5287 backend-test :
88+ needs : [backend-changes]
89+ if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) && needs.backend-changes.outputs.changes == 'true') }}
5390 strategy :
5491 fail-fast : false
5592 matrix :
68105 scikit-learn : " 1.6"
69106 coverage : true
70107 runs-on : ${{ matrix.os }}
108+ permissions :
109+ contents : read
71110 steps :
72111 - name : Checkout code
73112 uses : actions/checkout@v4
@@ -132,8 +171,7 @@ jobs:
132171
133172 - name : Show dependencies versions
134173 working-directory : skore/
135- run : |
136- python -c "import skore; skore.show_versions()"
174+ run : python -c 'import skore; skore.show_versions()'
137175
138176 - name : Test without coverage
139177 if : ${{ ! matrix.coverage }}
@@ -155,3 +193,16 @@ jobs:
155193 with :
156194 name : backend-coverage
157195 path : skore/coverage/
196+
197+ backend-all-green :
198+ needs :
199+ - backend-skip
200+ - backend-lint
201+ - backend-lockfiles
202+ - backend-test
203+ if : ${{ always() }}
204+ runs-on : Ubuntu-latest
205+ steps :
206+ - shell : bash
207+ run : |
208+ [[ ${{ contains(needs.*.result, 'failure') }} = false ]]
0 commit comments