Skip to content

Commit 561029a

Browse files
authored
[3.11] Convert doc.yml workflow to be reusable (GH-103914 + GH-105151) (#107043)
Co-authored-by: Sviatoslav Sydorenko <[email protected]> Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>. (cherry picked from commit 88d14da) (cherry picked from commit eaa6702)
1 parent 5a74566 commit 561029a

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

.github/workflows/build.yml

+25-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ permissions:
2626
contents: read
2727

2828
concurrency:
29-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
29+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
3030
cancel-in-progress: true
3131

3232
jobs:
@@ -35,6 +35,7 @@ jobs:
3535
runs-on: ubuntu-latest
3636
timeout-minutes: 10
3737
outputs:
38+
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
3839
run_tests: ${{ steps.check.outputs.run_tests }}
3940
run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }}
4041
config_hash: ${{ steps.config_hash.outputs.hash }}
@@ -68,6 +69,29 @@ jobs:
6869
id: config_hash
6970
run: |
7071
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT
72+
- name: Get a list of the changed documentation-related files
73+
if: github.event_name == 'pull_request'
74+
id: changed-docs-files
75+
uses: Ana06/[email protected]
76+
with:
77+
filter: |
78+
Doc/**
79+
Misc/**
80+
.github/workflows/reusable-docs.yml
81+
format: csv # works for paths with spaces
82+
- name: Check for docs changes
83+
if: >-
84+
github.event_name == 'pull_request'
85+
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
86+
id: docs-changes
87+
run: |
88+
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
89+
90+
check-docs:
91+
name: Docs
92+
needs: check_source
93+
if: fromJSON(needs.check_source.outputs.run-docs)
94+
uses: ./.github/workflows/reusable-docs.yml
7195

7296
check_abi:
7397
name: 'Check if the ABI has changed'

.github/workflows/doc.yml renamed to .github/workflows/reusable-docs.yml

+1-22
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,8 @@
11
name: Docs
22

33
on:
4+
workflow_call:
45
workflow_dispatch:
5-
#push:
6-
# branches:
7-
# - 'main'
8-
# - '3.11'
9-
# - '3.10'
10-
# - '3.9'
11-
# - '3.8'
12-
# - '3.7'
13-
# paths:
14-
# - 'Doc/**'
15-
pull_request:
16-
branches:
17-
- 'main'
18-
- '3.11'
19-
- '3.10'
20-
- '3.9'
21-
- '3.8'
22-
- '3.7'
23-
paths:
24-
- 'Doc/**'
25-
- 'Misc/**'
26-
- '.github/workflows/doc.yml'
276

287
permissions:
298
contents: read

0 commit comments

Comments
 (0)