PostCommit Python ValidatesRunner Spark

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit Python ValidatesRunner Spark

on:
  schedule:
    - cron: '15 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Python_ValidatesRunner_Spark.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Python_ValidatesRunner_Spark:
    if: |
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      startsWith(github.event.comment.body, 'Run Python Spark ValidatesRunner')
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    strategy:
      fail-fast: false
      matrix:
        job_name: ["beam_PostCommit_Python_ValidatesRunner_Spark"]
        job_phrase: ["Run Python Spark ValidatesRunner"]
        python_version: ['3.8', '3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          java-version: default
          python-version: ${{ matrix.python_version }}
      - name: Set PY_VER_CLEAN
        id: set_py_ver_clean
        run: |
          PY_VER=${{ matrix.python_version }}
          PY_VER_CLEAN=${PY_VER//.}
          echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT
      - name: Run sparkValidatesRunner script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:portable:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:sparkValidatesRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PostCommit Python Xlang Gcp Dataflow

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit Python Xlang Gcp Dataflow

on:
  schedule:
    - cron: '15 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Dataflow.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Python_Xlang_Gcp_Dataflow:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Python_Xlang_Gcp_Dataflow PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Python_Xlang_Gcp_Dataflow"]
        job_phrase: ["Run Python_Xlang_Gcp_Dataflow PostCommit"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            3.12
      - name: run PostCommit Python Xlang Gcp Dataflow script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:dataflow:gcpCrossLanguagePostCommit
          arguments: -PuseWheelDistribution
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PostCommit Python Xlang Gcp Direct

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit Python Xlang Gcp Direct

on:
  schedule:
    - cron: '30 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Direct.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Python_Xlang_Gcp_Direct:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Python_Xlang_Gcp_Direct PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Python_Xlang_Gcp_Direct"]
        job_phrase: ["Run Python_Xlang_Gcp_Direct PostCommit"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            3.12
      - name: run PostCommit Python Xlang Gcp Direct script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:direct:gcpCrossLanguagePostCommit
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PostCommit Python Xlang IO Dataflow

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit Python Xlang IO Dataflow

on:
  schedule:
    - cron: '30 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Python_Xlang_IO_Dataflow.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Python_Xlang_IO_Dataflow:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Python_Xlang_IO_Dataflow PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Python_Xlang_IO_Dataflow"]
        job_phrase: ["Run Python_Xlang_IO_Dataflow PostCommit"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            3.12
      - name: run PostCommit Python Xlang IO Dataflow script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:dataflow:ioCrossLanguagePostCommit
          arguments: |
            -PuseWheelDistribution \
            -PkafkaBootstrapServer=10.128.0.40:9094,10.128.0.28:9094,10.128.0.165:9094 \
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PostCommit SQL

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

name: PostCommit SQL

on:
  schedule:
    - cron: '30 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_SQL.json']
  workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_SQL:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 240
    strategy:
      matrix:
        job_name: [beam_PostCommit_SQL]
        job_phrase: [Run SQL PostCommit]
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run SQL PostCommit'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: run PostCommit SQL script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sqlPostCommit
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


PostCommit Sickbay Python

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

name: PostCommit Sickbay Python

on:
  schedule:
    - cron: '0 8 * * *'
  pull_request_target:
    paths: ['.github/trigger_files/beam_PostCommit_Sickbay_Python.json']
  workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Sickbay_Python:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase_1 }} ${{ matrix.python_version }} ${{ matrix.job_phrase_2 }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    strategy:
      fail-fast: false
      matrix:
        job_name: [beam_PostCommit_Sickbay_Python]
        job_phrase_1: [Run Python]
        job_phrase_2: [PostCommit Sickbay]
        python_version: ['3.8', '3.9', '3.10', '3.11', '3.12']
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      (startswith(github.event.comment.body, 'Run Python') &&
         endswith(github.event.comment.body, 'PostCommit Sickbay'))
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase_1 }} ${{ matrix.python_version }} ${{ matrix.job_phrase_2 }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase_1 }} ${{ matrix.python_version }} ${{ matrix.job_phrase_2 }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: ${{ matrix.python_version }}
      - name: Set PY_VER_CLEAN
        id: set_py_ver_clean
        run: |
          PY_VER=${{ matrix.python_version }}
          PY_VER_CLEAN=${PY_VER//.}
          echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT
      - name: run PostCommit Python ${{ matrix.python_version }} script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:dataflow:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:postCommitSickbay
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PostCommit TransformService Direct

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit TransformService Direct

on:
  schedule:
    - cron: '30 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_TransformService_Direct.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_TransformService_Direct:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run TransformService_Direct PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 120
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_TransformService_Direct"]
        job_phrase: ["Run TransformService_Direct PostCommit"]
        python_version: ['3.8','3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          java-version: 11
          python-version: |
            3.8
            ${{ matrix.python_version }}
      - name: run TransformService Direct script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:direct:xlang:transformServicePythonUsingJava
          arguments: |
            -PtestJavaVersion=11 \
            -Pjava11Home=$JAVA_HOME_11_X64 \
            -PpythonVersion=${{ matrix.python_version }} \
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python ${{ matrix.python_version }} Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PostCommit Website Test

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit Website Test

on:
  schedule:
    - cron: '30 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Website_Test.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Website_Test:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Full Website Test'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 60
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Website_Test"]
        job_phrase: ["Run Full Website Test"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: run PostCommit Website Test script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :website:testWebsite
          arguments: -PdisableExternal=false


PostCommit XVR Direct

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit XVR Direct

on:
  schedule:
    - cron: '30 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_XVR_Direct.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_XVR_Direct:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run XVR_Direct PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 120
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_XVR_Direct"]
        job_phrase: ["Run XVR_Direct PostCommit"]
        python_version: ['3.8','3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            ${{ matrix.python_version }}
      - name: run PostCommit XVR Direct script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        if: ${{ matrix.python_version != '3.8' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:direct:xlang:validatesCrossLanguageRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
            -PskipNonPythonTask=true \
      - name: run PostCommit XVR Direct script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        if: ${{ matrix.python_version == '3.8' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:direct:xlang:validatesCrossLanguageRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
            -PskipNonPythonTask=false \
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


PostCommit XVR Flink

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit XVR Flink

on:
  schedule:
    - cron: '30 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_XVR_Flink.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  FlinkVersion: 1.15

jobs:
  beam_PostCommit_XVR_Flink:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run XVR_Flink PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, highmem]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_XVR_Flink"]
        job_phrase: ["Run XVR_Flink PostCommit"]
        python_version: ['3.8','3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            ${{ matrix.python_version }}
      - name: run PostCommit XVR Flink script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        if: ${{ matrix.python_version != '3.8' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:flink:${{ env.FlinkVersion }}:job-server:validatesCrossLanguageRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
            -PskipNonPythonTask=true \
      - name: run PostCommit XVR Flink script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        if: ${{ matrix.python_version == '3.8' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:flink:${{ env.FlinkVersion }}:job-server:validatesCrossLanguageRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
            -PskipNonPythonTask=false \
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


PostCommit XVR GoUsingJava Dataflow

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit XVR GoUsingJava Dataflow

on:
  schedule:
    - cron: '45 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_XVR_GoUsingJava_Dataflow.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_XVR_GoUsingJava_Dataflow:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run XVR_GoUsingJava_Dataflow PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_XVR_GoUsingJava_Dataflow"]
        job_phrase: ["Run XVR_GoUsingJava_Dataflow PostCommit"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: GCloud Docker credential helper
        run: |
          gcloud auth configure-docker us.gcr.io
      - name: run XVR GoUsingJava Dataflow script
        env:
          USER: github-actions
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:google-cloud-dataflow-java:validatesCrossLanguageRunnerGoUsingJava
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


PostCommit XVR JavaUsingPython Dataflow

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit XVR JavaUsingPython Dataflow

on:
  schedule:
    - cron: '45 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_XVR_JavaUsingPython_Dataflow.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_XVR_JavaUsingPython_Dataflow:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run XVR_JavaUsingPython_Dataflow PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_XVR_JavaUsingPython_Dataflow"]
        job_phrase: ["Run XVR_JavaUsingPython_Dataflow PostCommit"]
        python_version: ['3.8','3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            ${{ matrix.python_version }}
      - name: run PostCommit XVR JavaUsingPython Dataflow script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:google-cloud-dataflow-java:validatesCrossLanguageRunnerJavaUsingPython
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit XVR PythonUsingJavaSQL Dataflow

on:
  schedule:
    - cron: '45 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_XVR_PythonUsingJavaSQL_Dataflow.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_XVR_PythonUsingJavaSQL_Dataflow:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run XVR_PythonUsingJavaSQL_Dataflow PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_XVR_PythonUsingJavaSQL_Dataflow"]
        job_phrase: ["Run XVR_PythonUsingJavaSQL_Dataflow PostCommit"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: 3.12
      - name: run PostCommit XVR PythonUsingJavaSQL Dataflow script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:google-cloud-dataflow-java:validatesCrossLanguageRunnerPythonUsingSql
          arguments: |
            -PpythonVersion=3.12 \
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PostCommit XVR PythonUsingJava Dataflow

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit XVR PythonUsingJava Dataflow

on:
  schedule:
    - cron: '45 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_XVR_PythonUsingJava_Dataflow.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_XVR_PythonUsingJava_Dataflow:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run XVR_PythonUsingJava_Dataflow PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_XVR_PythonUsingJava_Dataflow"]
        job_phrase: ["Run XVR_PythonUsingJava_Dataflow PostCommit"]
        python_version: ['3.8','3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            ${{ matrix.python_version }}
      - name: run PostCommit XVR PythonUsingJava Dataflow script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:google-cloud-dataflow-java:validatesCrossLanguageRunnerPythonUsingJava
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PostCommit XVR Samza

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit XVR Samza

on:
  schedule:
    - cron: '45 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_XVR_Samza.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_XVR_Samza:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run XVR_Samza PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_XVR_Samza"]
        job_phrase: ["Run XVR_Samza PostCommit"]
        python_version: ['3.8','3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            ${{ matrix.python_version }}
      - name: run PostCommit XVR Samza script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        if: ${{ matrix.python_version != '3.8' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:samza:job-server:validatesCrossLanguageRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
            -PskipNonPythonTask=true \
      - name: run PostCommit XVR Samza script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        if: ${{ matrix.python_version == '3.8' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:samza:job-server:validatesCrossLanguageRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
            -PskipNonPythonTask=false \
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


PostCommit XVR Spark3

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostCommit XVR Spark3

on:
  schedule:
    - cron: '45 5/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_XVR_Spark3.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_XVR_Spark3:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run XVR_Spark3 PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_XVR_Spark3"]
        job_phrase: ["Run XVR_Spark3 PostCommit"]
        python_version: ['3.8','3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: |
            3.8
            ${{ matrix.python_version }}
      - name: run PostCommit XVR Spark3 script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        if: ${{ matrix.python_version != '3.8' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:spark:3:job-server:validatesCrossLanguageRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
            -PskipNonPythonTask=true \
      - name: run PostCommit XVR Spark3 script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        if: ${{ matrix.python_version == '3.8' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:spark:3:job-server:validatesCrossLanguageRunner
          arguments: |
            -PpythonVersion=${{ matrix.python_version }} \
            -PskipNonPythonTask=false \
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


PostRelease Nightly Snapshot

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PostRelease Nightly Snapshot

on:
  workflow_dispatch:
    inputs:
      RELEASE:
        description: Beam version of current release (e.g. 2.XX.0)
        required: true
        default: '2.XX.0'
      SNAPSHOT_URL:
        description: Location of the staged artifacts in Maven central (https://repository.apache.org/content/repositories/orgapachebeam-NNNN/).
        required: true
  schedule:
    - cron: '15 16 * * *'

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

env:
    DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
    GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
    GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostRelease_NightlySnapshot:
    name: beam_PostRelease_NightlySnapshot
    runs-on: [self-hosted, ubuntu-20.04, main]
    steps:
      - uses: actions/checkout@v4
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          java-version: default
      - name: run PostRelease validation script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :release:runJavaExamplesValidationTask
          arguments: |
            -Pver='${{ github.event.inputs.RELEASE }}' \
            -Prepourl='${{ github.event.inputs.SNAPSHOT_URL }}' \


PreCommit Community Metrics

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PreCommit Community Metrics

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ['.test-infra/metrics/**', 'buildSrc/build.gradle.kts', '.github/workflows/beam_PreCommit_CommunityMetrics.yml']
  pull_request_target:
    branches: ['master', 'release-*']
    paths: ['.test-infra/metrics/**', 'buildSrc/build.gradle.kts', 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_CommunityMetrics.json']
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 1/6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PreCommit_CommunityMetrics:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    timeout-minutes: 120
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_CommunityMetrics]
        job_phrase: [Run CommunityMetrics PreCommit]
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run CommunityMetrics PreCommit'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          java-version: default
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Remove default github maven configuration
        run: rm ~/.m2/settings.xml
      - name: Install docker compose
        run: |
          sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
          sudo chmod +x /usr/local/bin/docker-compose
      - name: run Community Metrics PreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :communityMetricsPreCommit
          arguments: |
            -PKUBE_CONFIG_PATH='$HOME/.kube/config'


PreCommit GHA

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PreCommit GHA

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ['.github/**/*.yml']
  pull_request_target:
    branches: ['master', 'release-*' ]
    paths: ['.github/**/*.yml', 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_GHA.json']
  issue_comment:
    types: [created]
  schedule:
  - cron: '0 */6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PreCommit_GHA:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_GHA]
        job_phrase: [Run GHA PreCommit]
    timeout-minutes: 30
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run GHA PreCommit'
    steps:
    - uses: actions/checkout@v4
    - name: Setup repository
      uses: ./.github/actions/setup-action
      with:
        comment_phrase: ${{ matrix.job_phrase }}
        github_token: ${{ secrets.GITHUB_TOKEN }}
        github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    - name: Setup environment
      uses: ./.github/actions/setup-environment-action
      with:
        java-version: default
        go-version: default
    - name: run GHA PreCommit script
      uses: ./.github/actions/gradle-command-self-hosted-action
      with:
        gradle-command: :beam-test-gha:preCommit


PreCommit Go

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PreCommit Go

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ['model/**', 'sdks/go.mod', 'sdks/go.sum', 'sdks/go/**', 'release/**', '.github/workflows/beam_PreCommit_Go.yml']
  pull_request_target:
    branches: ['master', 'release-*']
    paths: ['model/**', 'sdks/go.mod', 'sdks/go.sum', 'sdks/go/**', 'release/**', 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Go.json']
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 1/6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PreCommit_Go:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_Go]
        job_phrase: [Run Go PreCommit]
    timeout-minutes: 120
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run Go PreCommit'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          java-version: default
          go-version: default
      - name: run goPreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :goPreCommit


PreCommit GoPortable

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PreCommit GoPortable

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ['model/**', 'sdks/go.mod', 'sdks/go.sum', 'sdks/go/**', 'release/**', '.github/workflows/beam_PreCommit_GoPortable.yml']
  pull_request_target:
    branches: ['master', 'release-*']
    paths: ['model/**', 'sdks/go.mod', 'sdks/go.sum', 'sdks/go/**', 'release/**', 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_GoPortable.json']
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 1/6 * * *'
  workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

# Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

jobs:
  beam_PreCommit_GoPortable:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_GoPortable]
        job_phrase: [Run GoPortable PreCommit]
    timeout-minutes: 120
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run GoPortable PreCommit'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
          java-version: default
      - name: Run goPortablePreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :goPortablePreCommit


PreCommit GoPrism

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PreCommit GoPrism

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ['model/**', 'sdks/go.mod', 'sdks/go.sum', 'sdks/go/**', 'release/**', '.github/workflows/beam_PreCommit_GoPrism.yml']
  pull_request_target:
    branches: ['master', 'release-*']
    paths: ['model/**', 'sdks/go.mod', 'sdks/go.sum', 'sdks/go/**', 'release/**', 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_GoPrism.json']
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 1/6 * * *'
  workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

# Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

jobs:
  beam_PreCommit_GoPrism:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_GoPrism]
        job_phrase: [Run GoPrism PreCommit]
    timeout-minutes: 120
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run GoPrism PreCommit'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
          java-version: default
      - name: Run goPrismPreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :goPrismPreCommit


# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

name: PreCommit Integration and Load Test Framework

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - 'it/**'
      - '.github/workflows/beam_PreCommit_ItFramework.yml'
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - 'it/**'
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_ItFramework.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 1/6 * * *'
  workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read
jobs:
  beam_PreCommit_ItFramework:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_ItFramework]
        job_phrase: [Run It_Framework PreCommit]
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run It_Framework PreCommit'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          java-version: default
      - name: run ItFrameworkPrecommit script
        run: ./gradlew -p it build
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


PreCommit Java

#    Licensed to the Apache Software Foundation (ASF) under one
#    or more contributor license agreements.  See the NOTICE file
#    distributed with this work for additional information
#    regarding copyright ownership.  The ASF licenses this file
#    to you under the Apache License, Version 2.0 (the
#    "License"); you may not use this file except in compliance
#    with the License.  You may obtain a copy of the License at
#      http://www.apache.org/licenses/LICENSE-2.0
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

name: PreCommit Java

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - 'model/**'
      - 'sdks/java/**'
      - 'runners/**'
      - 'examples/java/**'
      - 'examples/kotlin/**'
      - 'release/**'
      - '.github/workflows/beam_PreCommit_Java.yml'
      - '!sdks/java/extensions/sql/**'
      - '!sdks/java/io/amazon-web-services/**'
      - '!sdks/java/io/amazon-web-services2/**'
      - '!sdks/java/io/amqp/**'
      - '!sdks/java/io/azure/**'
      - '!sdks/java/io/cassandra/**'
      - '!sdks/java/io/cdap/**'
      - '!sdks/java/io/clickhouse/**'
      - '!sdks/java/io/csv/**'
      - '!sdks/java/io/debezium/**'
      - '!sdks/java/io/elasticsearch/**'
      - '!sdks/java/io/elasticsearch-tests/**'
      - '!sdks/java/io/file-schema-transform/**'
      - '!sdks/java/io/google-ads/**'
      - '!sdks/java/io/google-cloud-platform/**'
      - '!sdks/java/io/hadoop-common/**'
      - '!sdks/java/io/hadoop-file-system/**'
      - '!sdks/java/io/hadoop-format/**'
      - '!sdks/java/io/hbase/**'
      - '!sdks/java/io/hcatalog/**'
      - '!sdks/java/io/influxdb/**'
      - '!sdks/java/io/jdbc/**'
      - '!sdks/java/io/jms/**'
      - '!sdks/java/io/kafka/**'
      - '!sdks/java/io/kinesis/**'
      - '!sdks/java/io/kudu/**'
      - '!sdks/java/io/mqtt/**'
      - '!sdks/java/io/mongodb/**'
      - '!sdks/java/io/neo4j/**'
      - '!sdks/java/io/parquet/**'
      - '!sdks/java/io/pulsar/**'
      - '!sdks/java/io/rabbitmq/**'
      - '!sdks/java/io/redis/**'
      - '!sdks/java/io/rrio/**'
      - '!sdks/java/io/singlestore/**'
      - '!sdks/java/io/snowflake/**'
      - '!sdks/java/io/solr/**'
      - '!sdks/java/io/splunk/**'
      - '!sdks/java/io/thrift/**'
      - '!sdks/java/io/tika/**'

  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - 'model/**'
      - 'sdks/java/**'
      - 'runners/**'
      - 'examples/java/**'
      - 'examples/kotlin/**'
      - 'release/**'
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java.json'
      - '!sdks/java/extensions/sql/**'
      - '!sdks/java/io/amazon-web-services/**'
      - '!sdks/java/io/amazon-web-services2/**'
      - '!sdks/java/io/amqp/**'
      - '!sdks/java/io/azure/**'
      - '!sdks/java/io/cassandra/**'
      - '!sdks/java/io/cdap/**'
      - '!sdks/java/io/clickhouse/**'
      - '!sdks/java/io/csv/**'
      - '!sdks/java/io/debezium/**'
      - '!sdks/java/io/elasticsearch/**'
      - '!sdks/java/io/elasticsearch-tests/**'
      - '!sdks/java/io/file-schema-transform/**'
      - '!sdks/java/io/google-ads/**'
      - '!sdks/java/io/google-cloud-platform/**'
      - '!sdks/java/io/hadoop-common/**'
      - '!sdks/java/io/hadoop-file-system/**'
      - '!sdks/java/io/hadoop-format/**'
      - '!sdks/java/io/hbase/**'
      - '!sdks/java/io/hcatalog/**'
      - '!sdks/java/io/influxdb/**'
      - '!sdks/java/io/jdbc/**'
      - '!sdks/java/io/jms/**'
      - '!sdks/java/io/kafka/**'
      - '!sdks/java/io/kinesis/**'
      - '!sdks/java/io/kudu/**'
      - '!sdks/java/io/mqtt/**'
      - '!sdks/java/io/mongodb/**'
      - '!sdks/java/io/neo4j/**'
      - '!sdks/java/io/parquet/**'
      - '!sdks/java/io/pulsar/**'
      - '!sdks/java/io/rabbitmq/**'
      - '!sdks/java/io/redis/**'
      - '!sdks/java/io/rrio/**'
      - '!sdks/java/io/singlestore/**'
      - '!sdks/java/io/snowflake/**'
      - '!sdks/java/io/solr/**'
      - '!sdks/java/io/splunk/**'
      - '!sdks/java/io/thrift/**'
      - '!sdks/java/io/tika/**'
  issue_comment:
    types: [created]
  schedule:
    - cron: '30 2/6 * * *'
  workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PreCommit_Java:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      fail-fast: false
      matrix:
        job_name: [beam_PreCommit_Java]
        job_phrase: [Run Java PreCommit]
    timeout-minutes: 120
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run Java PreCommit'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: run Java PreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :javaPreCommit
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
            -PenableJacocoReport \
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'
      - name: Archive SpotBugs Results
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: SpotBugs Results
          path: '**/build/reports/spotbugs/*.html'
      - name: Publish SpotBugs Results
        uses: jwgmeligmeyling/spotbugs-github-action@v1.2
        if: always()
        with:
          name: Publish SpotBugs
          path: '**/build/reports/spotbugs/*.html'
      - name: Archive Jacoco Results
        uses: actions/upload-artifact@v4
        with:
          name: Jacoco Results
          path: '**/build/jacoco/report/**'
      - name: Upload coverage reports to Codecov
        uses: codecov/codecov-action@v3
        with:
          flags: java