From cbfeb2e5ec7d8d69966df3e81da459154077f0f0 Mon Sep 17 00:00:00 2001 From: Vlado Djerek <20559691+volatilemolotov@users.noreply.github.com> Date: Fri, 7 Jul 2023 19:05:53 +0200 Subject: [PATCH] fixes rerun call in matrix jobs (#27392) --- .github/workflows/README.md | 26 ++++++++++--------- .github/workflows/job_PreCommit_Python.yml | 14 +++++++--- .../job_PreCommit_Python_Dataframes.yml | 15 +++++++---- ...l => job_PreCommit_Python_DockerBuild.yml} | 15 +++++++---- .../job_PreCommit_Python_Examples.yml | 16 ++++++++---- .../job_PreCommit_Python_Runners.yml | 15 +++++++---- .../job_PreCommit_Python_Transforms.yml | 15 +++++++---- .../job_Precommit_Python_Coverage.yml | 4 +-- 8 files changed, 77 insertions(+), 43 deletions(-) rename .github/workflows/{job_Precommit_Python_DockerBuild.yml => job_PreCommit_Python_DockerBuild.yml} (84%) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index c183d4f0578f..d510ec2fd882 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -14,15 +14,17 @@ specific language governing permissions and limitations under the License. --> -| Workflow name | Trigger Phrase | Cron Status | -|:-------------:|:--------------:|:-----------:| -| [ Go Precommit ](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Go.yml) | `Run Go PreCommit`| [![Go Precommit](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Go.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Go.yml) | -| [ Python PreCommit Docker ](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_DockerBuild.yml) | `Run PythonDocker PreCommit`| [![.github/workflows/job_Precommit_Python_DockerBuild.yml](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_DockerBuild.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_DockerBuild.yml) | -| [ Python Precommit Formatter ](https://github.com/apache/beam/actions/workflows/job_PreCommit_PythonAutoformatter.yml) | `Run PythonFormatter PreCommit`| [![.github/workflows/job_PreCommit_PythonAutoformatter.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_PythonAutoformatter.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_PythonAutoformatter.yml) | -| [ Python PreCommit Coverage ](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_Coverage.yml) | `Run Python_Coverage PreCommit`| [![.github/workflows/job_Precommit_Python_Coverage.yml](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_Coverage.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_Coverage.yml) | -| [ Python PreCommit Dataframes ](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Dataframes.yml) | `Run Python_Dataframes PreCommit`| [![.github/workflows/job_PreCommit_Python_Dataframes.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Dataframes.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Dataframes.yml) | -| [ Python PreCommit Examples ](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Examples.yml) | `Run Python_Examples PreCommit` | [![.github/workflows/job_PreCommit_Python_Examples.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Examples.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Examples.yml) | -| [ Python PreCommit Runners ](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Runners.yml) | `Run Python_Runners PreCommit`| [![.github/workflows/job_PreCommit_Python_Runners.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Runners.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Runners.yml) | -| [ Python PreCommit Lint ](https://github.com/apache/beam/actions/workflows/job_Precommit_PythonLint.yml) | `Run PythonLint PreCommit` | [![.github/workflows/job_Precommit_PythonLint.yml](https://github.com/apache/beam/actions/workflows/job_Precommit_PythonLint.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_Precommit_PythonLint.yml) | -| [ Python PreCommit Transforms ](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Transforms.yml)| `Run Python_Transforms PreCommit`| [![.github/workflows/job_PreCommit_Python_Transforms.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Transforms.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Transforms.yml) | -| [ Python PreCommit ](https://github.com/apache/beam/actions/workflows/job_Precommit_Python.yml) | `Run Python PreCommit` | [![.github/workflows/job_Precommit_Python.yml](https://github.com/apache/beam/actions/workflows/job_Precommit_Python.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_Precommit_Python.yml) | +Please note that jobs with matrix need to have matrix element in the comment. Example: +```Run Python PreCommit (3.8)``` +| Workflow name | Matrix | Trigger Phrase | Cron Status | +|:-------------:|:------:|:--------------:|:-----------:| +| [ Go Precommit ](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Go.yml) | N/A |`Run Go PreCommit`| [![Go Precommit](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Go.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Go.yml) | +| [ Python PreCommit Docker ](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_DockerBuild.yml) | ['3.8','3.9','3.10','3.11'] | `Run PythonDocker PreCommit (matrix_element)`| [![.github/workflows/job_Precommit_Python_DockerBuild.yml](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_DockerBuild.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_DockerBuild.yml) | +| [ Python Precommit Formatter ](https://github.com/apache/beam/actions/workflows/job_PreCommit_PythonAutoformatter.yml) | N/A | `Run PythonFormatter PreCommit`| [![.github/workflows/job_PreCommit_PythonAutoformatter.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_PythonAutoformatter.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_PythonAutoformatter.yml) | +| [ Python PreCommit Coverage ](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_Coverage.yml) | N/A | `Run Python_Coverage PreCommit`| [![.github/workflows/job_Precommit_Python_Coverage.yml](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_Coverage.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_Precommit_Python_Coverage.yml) | +| [ Python PreCommit Dataframes ](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Dataframes.yml) | ['3.8','3.9','3.10','3.11'] | `Run Python_Dataframes PreCommit (matrix_element)`| [![.github/workflows/job_PreCommit_Python_Dataframes.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Dataframes.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Dataframes.yml) | +| [ Python PreCommit Examples ](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Examples.yml) | ['3.8','3.9','3.10','3.11'] | `Run Python_Examples PreCommit (matrix_element)` | [![.github/workflows/job_PreCommit_Python_Examples.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Examples.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Examples.yml) | +| [ Python PreCommit Runners ](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Runners.yml) | ['3.8','3.9','3.10','3.11'] | `Run Python_Runners PreCommit (matrix_element)`| [![.github/workflows/job_PreCommit_Python_Runners.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Runners.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Runners.yml) | +| [ Python PreCommit Lint ](https://github.com/apache/beam/actions/workflows/job_Precommit_PythonLint.yml) | N/A | `Run PythonLint PreCommit` | [![.github/workflows/job_Precommit_PythonLint.yml](https://github.com/apache/beam/actions/workflows/job_Precommit_PythonLint.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_Precommit_PythonLint.yml) | +| [ Python PreCommit Transforms ](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Transforms.yml) | ['3.8','3.9','3.10','3.11'] | `Run Python_Transforms PreCommit (matrix_element)`| [![.github/workflows/job_PreCommit_Python_Transforms.yml](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Transforms.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_PreCommit_Python_Transforms.yml) | +| [ Python PreCommit ](https://github.com/apache/beam/actions/workflows/job_Precommit_Python.yml) | ['3.8','3.9','3.10','3.11'] | `Run Python PreCommit (matrix_element)` | [![.github/workflows/job_Precommit_Python.yml](https://github.com/apache/beam/actions/workflows/job_Precommit_Python.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/job_Precommit_Python.yml) | diff --git a/.github/workflows/job_PreCommit_Python.yml b/.github/workflows/job_PreCommit_Python.yml index 31591e08a67a..f76f08b95589 100644 --- a/.github/workflows/job_PreCommit_Python.yml +++ b/.github/workflows/job_PreCommit_Python.yml @@ -44,32 +44,38 @@ permissions: jobs: beam_PreCommit_Python: strategy: + fail-fast: false matrix: python_version: ['3.8','3.9','3.10','3.11'] if: | github.event_name == 'push' || github.event_name == 'pull_request_target' || github.event.comment.body == 'Run Python PreCommit' || + startsWith(github.event.comment.body, 'Run Python PreCommit') || github.event_name == 'schedule' runs-on: [self-hosted, ubuntu-20.04] steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set comment body with matrix + id: set_comment_body + run: | + echo "comment_body=Run Python PreCommit (${{ matrix.python_version }})" >> $GITHUB_OUTPUT - name: Rerun on comment - if: github.event.comment.body == 'Run Python PreCommit' + if: github.event.comment.body == steps.set_comment_body.outputs.comment_body uses: ./.github/actions/rerun-job-action with: pull_request_url: ${{ github.event.issue.pull_request.url }} github_repository: ${{ github.repository }} github_token: ${{ secrets.GITHUB_TOKEN }} - github_job: ${{ github.job }} + github_job: "${{ github.job }} (${{ matrix.python_version }})" github_current_run_id: ${{ github.run_id }} - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - name: Install Java - uses: actions/setup-java@v3.8.0 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '8' diff --git a/.github/workflows/job_PreCommit_Python_Dataframes.yml b/.github/workflows/job_PreCommit_Python_Dataframes.yml index d3cda14f779f..285420d7a6e3 100644 --- a/.github/workflows/job_PreCommit_Python_Dataframes.yml +++ b/.github/workflows/job_PreCommit_Python_Dataframes.yml @@ -43,32 +43,37 @@ permissions: jobs: beam_PreCommit_Python_Dataframes: strategy: + fail-fast: false matrix: python_version: ['3.8','3.9','3.10','3.11'] if: | github.event_name == 'push' || github.event_name == 'pull_request_target' || - github.event.comment.body == 'Run Python_Dataframes PreCommit' || + startsWith(github.event.comment.body, 'Run Python_Dataframes PreCommit') || github.event_name == 'schedule' runs-on: [self-hosted, ubuntu-20.04] steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set comment body with matrix + id: set_comment_body + run: | + echo "comment_body=Run Python_Dataframes PreCommit (${{ matrix.python_version }})" >> $GITHUB_OUTPUT - name: Rerun on comment - if: github.event.comment.body == 'Run Python_Dataframes PreCommit' + if: github.event.comment.body == steps.set_comment_body.outputs.comment_body uses: ./.github/actions/rerun-job-action with: pull_request_url: ${{ github.event.issue.pull_request.url }} github_repository: ${{ github.repository }} github_token: ${{ secrets.GITHUB_TOKEN }} - github_job: ${{ github.job }} + github_job: "${{ github.job }} (${{ matrix.python_version }})" github_current_run_id: ${{ github.run_id }} - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - name: Install Java - uses: actions/setup-java@v3.8.0 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '8' diff --git a/.github/workflows/job_Precommit_Python_DockerBuild.yml b/.github/workflows/job_PreCommit_Python_DockerBuild.yml similarity index 84% rename from .github/workflows/job_Precommit_Python_DockerBuild.yml rename to .github/workflows/job_PreCommit_Python_DockerBuild.yml index c98f68250ff3..fff0afe2462b 100644 --- a/.github/workflows/job_Precommit_Python_DockerBuild.yml +++ b/.github/workflows/job_PreCommit_Python_DockerBuild.yml @@ -44,36 +44,41 @@ permissions: jobs: beam_PreCommit_PythonDocker: strategy: + fail-fast: false matrix: python_version: ['3.8','3.9','3.10','3.11'] if: | github.event_name == 'push' || github.event_name == 'pull_request_target' || - github.event.comment.body == 'Run PythonDocker PreCommit' || + startsWith(github.event.comment.body, 'Run PythonDocker PreCommit') || github.event_name == 'schedule' runs-on: [self-hosted, ubuntu-20.04] steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set comment body with matrix + id: set_comment_body + run: | + echo "comment_body=Run PythonDocker PreCommit (${{ matrix.python_version }})" >> $GITHUB_OUTPUT - name: Rerun on comment - if: github.event.comment.body == 'Run PythonDocker PreCommit' + if: github.event.comment.body == steps.set_comment_body.outputs.comment_body uses: ./.github/actions/rerun-job-action with: pull_request_url: ${{ github.event.issue.pull_request.url }} github_repository: ${{ github.repository }} github_token: ${{ secrets.GITHUB_TOKEN }} - github_job: ${{ github.job }} + github_job: "${{ github.job }} (${{ matrix.python_version }})" github_current_run_id: ${{ github.run_id }} - name: Install Java - uses: actions/setup-java@v3.8.0 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '8' - uses: actions/setup-go@v4 with: go-version: '1.16' - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - name: Setup Gradle diff --git a/.github/workflows/job_PreCommit_Python_Examples.yml b/.github/workflows/job_PreCommit_Python_Examples.yml index b9071b81a2aa..90a37e234512 100644 --- a/.github/workflows/job_PreCommit_Python_Examples.yml +++ b/.github/workflows/job_PreCommit_Python_Examples.yml @@ -44,32 +44,38 @@ permissions: jobs: beam_PreCommit_Python_Examples: strategy: + fail-fast: false matrix: python_version: ['3.8','3.9','3.10','3.11'] if: | github.event_name == 'push' || github.event_name == 'pull_request_target' || - github.event.comment.body == 'Run Python_Examples PreCommit' || + startsWith(github.event.comment.body, 'Run Python_Examples PreCommit') || github.event_name == 'schedule' runs-on: [self-hosted, ubuntu-20.04] steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set comment body with matrix + id: set_comment_body + run: | + echo "comment_body=Run Python_Dataframes PreCommit (${{ matrix.python_version }})" >> $GITHUB_OUTPUT + - name: Rerun on comment - if: github.event.comment.body == 'Run Python_Examples PreCommit' + if: github.event.comment.body == steps.set_comment_body.outputs.comment_body uses: ./.github/actions/rerun-job-action with: pull_request_url: ${{ github.event.issue.pull_request.url }} github_repository: ${{ github.repository }} github_token: ${{ secrets.GITHUB_TOKEN }} - github_job: ${{ github.job }} + github_job: "${{ github.job }} (${{ matrix.python_version }})" github_current_run_id: ${{ github.run_id }} - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - name: Install Java - uses: actions/setup-java@v3.8.0 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '8' diff --git a/.github/workflows/job_PreCommit_Python_Runners.yml b/.github/workflows/job_PreCommit_Python_Runners.yml index 7fb0d162812a..33204788b635 100644 --- a/.github/workflows/job_PreCommit_Python_Runners.yml +++ b/.github/workflows/job_PreCommit_Python_Runners.yml @@ -45,12 +45,13 @@ permissions: jobs: beam_PreCommit_Python_Runners: strategy: + fail-fast: false matrix: python_version: ['3.8','3.9','3.10','3.11'] if: | github.event_name == 'push' || github.event_name == 'pull_request_target' || - github.event.comment.body == 'Run Python_Runners PreCommit' || + startsWith(github.event.comment.body, 'Run Python_Runners PreCommit') || github.event_name == 'schedule' runs-on: [self-hosted, ubuntu-20.04] @@ -58,20 +59,24 @@ jobs: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set comment body with matrix + id: set_comment_body + run: | + echo "comment_body=Run Python_Runners PreCommit (${{ matrix.python_version }})" >> $GITHUB_OUTPUT - name: Rerun on comment - if: github.event.comment.body == 'Run Python_Runners PreCommit' + if: github.event.comment.body == steps.set_comment_body.outputs.comment_body uses: ./.github/actions/rerun-job-action with: pull_request_url: ${{ github.event.issue.pull_request.url }} github_repository: ${{ github.repository }} github_token: ${{ secrets.GITHUB_TOKEN }} - github_job: ${{ github.job }} + github_job: "${{ github.job }} (${{ matrix.python_version }})" github_current_run_id: ${{ github.run_id }} - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - name: Install Java - uses: actions/setup-java@v3.8.0 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '8' diff --git a/.github/workflows/job_PreCommit_Python_Transforms.yml b/.github/workflows/job_PreCommit_Python_Transforms.yml index 4ab2582242be..eae77bbfe082 100644 --- a/.github/workflows/job_PreCommit_Python_Transforms.yml +++ b/.github/workflows/job_PreCommit_Python_Transforms.yml @@ -45,32 +45,37 @@ permissions: jobs: beam_PreCommit_Python_Transforms: strategy: + fail-fast: false matrix: python_version: ['3.8','3.9','3.10','3.11'] if: | github.event_name == 'push' || github.event_name == 'pull_request_target' || - github.event.comment.body == 'Run Python_Transforms PreCommit' || + startsWith(github.event.comment.body, 'Run Python_Transforms PreCommit') || github.event_name == 'schedule' runs-on: [self-hosted, ubuntu-20.04] steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set comment body with matrix + id: set_comment_body + run: | + echo "comment_body=Run Python_Transforms PreCommit (${{ matrix.python_version }})" >> $GITHUB_OUTPUT - name: Rerun on comment - if: github.event.comment.body == 'Run Python_Transforms PreCommit' + if: github.event.comment.body == steps.set_comment_body.outputs.comment_body uses: ./.github/actions/rerun-job-action with: pull_request_url: ${{ github.event.issue.pull_request.url }} github_repository: ${{ github.repository }} github_token: ${{ secrets.GITHUB_TOKEN }} - github_job: ${{ github.job }} + github_job: "${{ github.job }} (${{ matrix.python_version }})" github_current_run_id: ${{ github.run_id }} - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - name: Install Java - uses: actions/setup-java@v3.8.0 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '8' diff --git a/.github/workflows/job_Precommit_Python_Coverage.yml b/.github/workflows/job_Precommit_Python_Coverage.yml index c58af346d248..a1955c6fd394 100644 --- a/.github/workflows/job_Precommit_Python_Coverage.yml +++ b/.github/workflows/job_Precommit_Python_Coverage.yml @@ -63,11 +63,11 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} github_job: ${{ github.job }} github_current_run_id: ${{ github.run_id }} - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: '3.8' - name: Install Java - uses: actions/setup-java@v3.8.0 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '8'