From ba7a9f966060f411f1b617a0eef1da62bdd678fb Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 27 Apr 2023 01:37:56 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8E=A8=F0=9F=A7=AA=20Convert=20`doc.y?= =?UTF-8?q?ml`=20workflow=20to=20be=20reusable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch is meant to simplify the maintenance of multiple complex workflow definitions that are tied together into a single workflow later on. --- .github/workflows/build.yml | 19 ++++++++++++- .../workflows/{doc.yml => reusable-docs.yml} | 27 ++----------------- 2 files changed, 20 insertions(+), 26 deletions(-) rename .github/workflows/{doc.yml => reusable-docs.yml} (91%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1db6ffea937d48..ab7900553ae00a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,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: @@ -37,6 +37,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_hypothesis: ${{ steps.check.outputs.run_hypothesis }} config_hash: ${{ steps.config_hash.outputs.hash }} @@ -79,6 +80,22 @@ 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_generated_files: name: 'Check if generated files are up to date' diff --git a/.github/workflows/doc.yml b/.github/workflows/reusable-docs.yml similarity index 91% rename from .github/workflows/doc.yml rename to .github/workflows/reusable-docs.yml index ec900ce68a1dde..82c166a41e5674 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/reusable-docs.yml @@ -1,31 +1,8 @@ -name: Docs +name: 📝 on: + workflow_call: workflow_dispatch: - #push: - # branches: - # - 'main' - # - '3.12' - # - '3.11' - # - '3.10' - # - '3.9' - # - '3.8' - # - '3.7' - # paths: - # - 'Doc/**' - pull_request: - branches: - - 'main' - - '3.12' - - '3.11' - - '3.10' - - '3.9' - - '3.8' - - '3.7' - paths: - - 'Doc/**' - - 'Misc/**' - - '.github/workflows/doc.yml' permissions: contents: read From 63e7b6bfe9269e52bf637a12f5c86d1220070859 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 2 May 2023 17:44:36 +0200 Subject: [PATCH 2/2] Replace emojis in workflow and job names with text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change reverts using a 📝 emoji as a UI-facing component within GitHub Actions CI/CD and related web pages. It has been requested in the following code review thread: https://github.com/python/cpython/pull/97533#discussion_r1178495428 Co-Authored-By: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade --- .github/workflows/build.yml | 6 ++++++ .github/workflows/reusable-docs.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab7900553ae00a..1d97c0a60928e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,6 +97,12 @@ jobs: 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_generated_files: name: 'Check if generated files are up to date' runs-on: ubuntu-latest diff --git a/.github/workflows/reusable-docs.yml b/.github/workflows/reusable-docs.yml index 82c166a41e5674..8a271e867c8b4d 100644 --- a/.github/workflows/reusable-docs.yml +++ b/.github/workflows/reusable-docs.yml @@ -1,4 +1,4 @@ -name: 📝 +name: Docs on: workflow_call: