From fb30a7bf854765040e154d7532f850c7a1a89811 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sun, 28 May 2023 17:21:29 +0200 Subject: [PATCH 1/2] [3.11] Convert `doc.yml` workflow to be reusable (GH-103914) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade . (cherry picked from commit 88d14da76f579fe014cbd7c15e42be4234135fe9) Co-authored-by: Sviatoslav Sydorenko --- .github/workflows/build.yml | 25 ++++++++++++++++++- .../workflows/{doc.yml => reusable-docs.yml} | 23 +---------------- 2 files changed, 25 insertions(+), 23 deletions(-) rename .github/workflows/{doc.yml => reusable-docs.yml} (89%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6848ed6f54bf0e..ce3c390fa42df9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ permissions: contents: read concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable cancel-in-progress: true jobs: @@ -35,6 +35,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 outputs: + run-docs: ${{ steps.docs-changes.outputs.run-docs || false }} run_tests: ${{ steps.check.outputs.run_tests }} run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }} config_hash: ${{ steps.config_hash.outputs.hash }} @@ -68,6 +69,28 @@ jobs: id: config_hash run: | echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT + - name: Get a list of the changed documentation-related files + if: github.event_name == 'pull_request' + id: changed-docs-files + uses: Ana06/get-changed-files@v2.2.0 + with: + filter: | + Doc/** + Misc/** + .github/workflows/reusable-docs.yml + - name: Check for docs changes + if: >- + github.event_name == 'pull_request' + && steps.changed-docs-files.outputs.added_modified_renamed != '' + id: docs-changes + run: | + echo "run-docs=true" >> "${GITHUB_OUTPUT}" + + check-docs: + name: Docs + needs: check_source + if: fromJSON(needs.check_source.outputs.run-docs) + uses: ./.github/workflows/reusable-docs.yml check_abi: name: 'Check if the ABI has changed' diff --git a/.github/workflows/doc.yml b/.github/workflows/reusable-docs.yml similarity index 89% rename from .github/workflows/doc.yml rename to .github/workflows/reusable-docs.yml index e32078c67fba60..eade14bc8d6191 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/reusable-docs.yml @@ -1,29 +1,8 @@ name: Docs on: + workflow_call: workflow_dispatch: - #push: - # branches: - # - 'main' - # - '3.11' - # - '3.10' - # - '3.9' - # - '3.8' - # - '3.7' - # paths: - # - 'Doc/**' - pull_request: - branches: - - 'main' - - '3.11' - - '3.10' - - '3.9' - - '3.8' - - '3.7' - paths: - - 'Doc/**' - - 'Misc/**' - - '.github/workflows/doc.yml' permissions: contents: read From aa3887633156f0e0f3f6c40f38724c6bb8a42cd6 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Wed, 21 Jun 2023 12:42:59 +0200 Subject: [PATCH 2/2] Use CSV-separated outputs @ get-changed-files @ CI (#105151) Co-authored-by: Hugo van Kemenade (cherry picked from commit eaa670228066220f08c8d73f80365c50058d40b8) --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce3c390fa42df9..5dc63ff64e9ca2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,6 +78,7 @@ jobs: Doc/** Misc/** .github/workflows/reusable-docs.yml + format: csv # works for paths with spaces - name: Check for docs changes if: >- github.event_name == 'pull_request'