Skip to content

Commit 563c861

Browse files
committed
ci: Introduce sphinx as a "must-be-green" job
1 parent b78c2ce commit 563c861

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

.github/workflows/sphinx.yml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,9 @@ name: sphinx
4848

4949
on:
5050
pull_request:
51-
paths:
52-
- '.github/actions/sphinx/**'
53-
- '.github/workflows/sphinx.yml'
54-
- 'examples/**'
55-
- 'sphinx/**'
56-
- 'skore/**'
5751
push:
5852
branches:
5953
- main
60-
paths:
61-
- '.github/actions/sphinx/**'
62-
- '.github/workflows/sphinx.yml'
63-
- 'examples/**'
64-
- 'sphinx/**'
65-
- 'skore/**'
6654
release:
6755
types: [released]
6856
merge_group:
@@ -73,8 +61,32 @@ concurrency:
7361
cancel-in-progress: true
7462

7563
jobs:
64+
sphinx-changes:
65+
runs-on: ubuntu-latest
66+
outputs:
67+
changes: ${{ steps.filter.outputs.sphinx }}
68+
permissions:
69+
pull-requests: read
70+
steps:
71+
- name: Checkout code
72+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
73+
74+
- name: Define if at least one file has changed
75+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
76+
id: filter
77+
with:
78+
filters: |
79+
sphinx:
80+
- '.github/actions/sphinx/**'
81+
- '.github/workflows/sphinx.yml'
82+
- 'examples/**'
83+
- 'sphinx/**'
84+
- 'skore/**'
85+
7686
sphinx-version:
7787
runs-on: ubuntu-latest
88+
needs: [sphinx-changes]
89+
if: ${{ (! contains(fromJSON('["pull_request", "merge_group"]'), github.event_name)) || needs.sphinx-changes.outputs.changes == 'true' }}
7890
outputs:
7991
SPHINX_VERSION: ${{ steps.sphinx-version.outputs.SPHINX_VERSION }}
8092
SPHINX_RELEASE: ${{ steps.sphinx-version.outputs.SPHINX_RELEASE }}
@@ -99,7 +111,8 @@ jobs:
99111
100112
sphinx-build:
101113
runs-on: ubuntu-latest
102-
needs: sphinx-version
114+
needs: [sphinx-version]
115+
if: ${{ (! contains(fromJSON('["pull_request", "merge_group"]'), github.event_name)) || needs.sphinx-changes.outputs.changes == 'true' }}
103116
steps:
104117
- uses: actions/checkout@v4
105118
with:
@@ -241,3 +254,18 @@ jobs:
241254
- uses: geekyeggo/delete-artifact@v5
242255
with:
243256
name: sphinx-html-artifact
257+
258+
sphinx:
259+
needs:
260+
- sphinx-changes
261+
- sphinx-version
262+
- sphinx-build
263+
- sphinx-deploy-html
264+
- sphinx-deploy-root-files
265+
- sphinx-clean-artifacts
266+
if: ${{ always() }}
267+
runs-on: Ubuntu-latest
268+
steps:
269+
- shell: bash
270+
run: |
271+
[[ ${{ contains(needs.*.result, 'failure') }} = false ]]

0 commit comments

Comments
 (0)