PreCommit Java Splunk IO 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: PreCommit Java Splunk IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/splunk/**"
      - ".github/workflows/beam_PreCommit_Java_Splunk_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/splunk/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Splunk_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '30 2/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: 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.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_Java_Splunk_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Splunk_IO_Direct"]
        job_phrase: ["Run Java_Splunk_IO_Direct PreCommit"]
    timeout-minutes: 60
    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_Splunk_IO_Direct PreCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    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 Splunk IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:splunk:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - 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'


PreCommit Java Thrift IO 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: PreCommit Java Thrift IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/thrift/**"
      - ".github/workflows/beam_PreCommit_Java_Thrift_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/thrift/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Thrift_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '30 2/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: 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.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_Java_Thrift_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Thrift_IO_Direct"]
        job_phrase: ["Run Java_Thrift_IO_Direct PreCommit"]
    timeout-minutes: 60
    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_Thrift_IO_Direct PreCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    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 Thrift IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:thrift:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - 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'


PreCommit Java Tika IO 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: PreCommit Java Tika IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/tika/**"
      - ".github/workflows/beam_PreCommit_Java_Tika_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/tika/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Tika_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '30 2/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: 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.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_Java_Tika_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Tika_IO_Direct"]
        job_phrase: ["Run Java_Tika_IO_Direct PreCommit"]
    timeout-minutes: 60
    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_Tika_IO_Direct PreCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    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 Tika IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:tika:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - 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'


PreCommit Kotlin Examples

# 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 Kotlin Examples

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
    - 'model/**'
    - 'sdks/java/**'
    - 'runners/flink/**'
    - 'runners/spark/**'
    - 'runners/direct-java/**'
    - 'examples/kotlin/**'
    - 'release/**'
    - '.github/workflows/beam_PreCommit_Kotlin_Examples.yml'
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - 'model/**'
      - 'sdks/java/**'
      - 'runners/flink/**'
      - 'runners/spark/**'
      - 'runners/direct-java/**'
      - 'examples/kotlin/**'
      - 'release/**'
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Kotlin_Examples.json'
  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: 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_PreCommit_Kotlin_Examples:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    timeout-minutes: 120
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_Kotlin_Examples]
        job_phrase: [Run Kotlin_Examples 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 Kotlin_Examples 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 Kotlin Examples script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :examples:kotlin:preCommit


PreCommit Portable 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: PreCommit Portable Python

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - 'model/**'
      - 'runners/core-construction-java/**'
      - 'runners/core-java/**'
      - 'runners/extensions-java/**'
      - 'runners/flink/**'
      - 'runners/java-fn-execution/**'
      - 'runners/reference/**'
      - 'sdks/python/**'
      - 'release/**'
      - '.github/workflows/beam_PreCommit_Portable_Python.yml'
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - 'model/**'
      - 'runners/core-construction-java/**'
      - 'runners/core-java/**'
      - 'runners/extensions-java/**'
      - 'runners/flink/**'
      - 'runners/java-fn-execution/**'
      - 'runners/reference/**'
      - 'sdks/python/**'
      - 'release/**'
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Portable_Python.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '30 2/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_Portable_Python:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    timeout-minutes: 120
    runs-on: ['self-hosted', ubuntu-20.04, main]
    strategy:
      fail-fast: false
      matrix:
        job_name: ['beam_PreCommit_Portable_Python']
        job_phrase: ['Run Portable_Python PreCommit']
        python_version: ['3.8', '3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      startsWith(github.event.comment.body, 'Run Portable_Python PreCommit')
    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 }}
            3.8
      - 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 Portable Python 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}}:preCommitPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}


PreCommit 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: PreCommit Python
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "model/**","sdks/python/**","release/**",".github/workflows/beam_PreCommit_Python.yml"]
  schedule:
    - cron: '0 3/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: 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.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_Python:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    strategy:
      fail-fast: false
      matrix:
        job_name: ['beam_PreCommit_Python']
        job_phrase: ['Run Python PreCommit']
        python_version: ['3.8','3.9','3.10','3.11','3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      startsWith(github.event.comment.body, 'Run Python PreCommit')
    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 pythonPreCommit
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:tox:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:preCommitPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}
          arguments: |
            -Pposargs="--ignore=apache_beam/dataframe/ --ignore=apache_beam/ml/ --ignore=apache_beam/examples/ --ignore=apache_beam/runners/ --ignore=apache_beam/transforms/" \
            -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'


PreCommit Python Docker

# 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 Python Docker
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_PythonDocker.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "model/**","sdks/python/**","release/**",".github/workflows/beam_PreCommit_PythonDocker.yml"]
  schedule:
    - cron: '0 3/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_PythonDocker:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 30
    strategy:
      fail-fast: false
      matrix:
        job_name: ["beam_PreCommit_PythonDocker"]
        job_phrase: ["Run PythonDocker PreCommit"]
        python_version: ['3.8','3.9','3.10','3.11','3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      startsWith(github.event.comment.body, 'Run PythonDocker PreCommit')
    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 }}
          go-version: default
      - name: Setup Buildx
        uses: docker/setup-buildx-action@v2
        with:
          install: true
          driver: 'docker'
      - 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 pythonDockerBuildPreCommit
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:container:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:docker
          arguments: |
            -Pposargs=apache_beam/dataframe/ \
            -PpythonVersion=${{ matrix.python_version }}


PreCommit Python Docs

# 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 Python Docs

on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: ["sdks/python/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_PythonDocs.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ["sdks/python/**",".github/workflows/beam_PreCommit_PythonDocs.yml"]
  schedule:
    - cron: '0 3/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_PythonDocs:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_PythonDocs]
        job_phrase: [Run PythonDocs 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 PythonDocs 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
          python-version: default
      - name: run pythonDocsPreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :pythonDocsPreCommit


PreCommit Python Formatter

# 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 Python Formatter
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "sdks/python/apache_beam/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_PythonFormatter.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "sdks/python/apache_beam/**",".github/workflows/beam_PreCommit_PythonFormatter.yml"]
  schedule:
    - cron: '0 3/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_PythonFormatter:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_PythonFormatter]
        job_phrase: [Run PythonFormatter 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 PythonFormatter 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
          python-version: default
      - name: run pythonFormatterPreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :pythonFormatterPreCommit


PreCommit Python Lint

# 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 Python Lint
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: ["sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_PythonLint.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ["sdks/python/**","release/**",".github/workflows/beam_PreCommit_PythonLint.yml"]
  schedule:
    - cron: '0 3/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_PythonLint:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_PythonLint]
        job_phrase: [Run PythonLint 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 PythonLint 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
          python-version: default
          go-version: default
      - name: run pythonLintPreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :pythonLintPreCommit


PreCommit Python Coverage

# 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 Python Coverage
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python_Coverage.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "model/**","sdks/python/**","release/**", ".github/workflows/beam_PreCommit_Python_Coverage.yml"]
  schedule:
    - cron: '45 2/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: 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.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 }}
  HF_INFERENCE_TOKEN: ${{ secrets.HF_INFERENCE_TOKEN }}

jobs:
  beam_PreCommit_Python_Coverage:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_Python_Coverage]
        job_phrase: [Run Python_Coverage PreCommit]
    timeout-minutes: 180
    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 Python_Coverage 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
          python-version: default
      - name: Run preCommitPyCoverage
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:tox:py38:preCommitPyCoverage
      - uses: codecov/codecov-action@v3
        with:
          flags: python
          directory: sdks/python
      - 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'


PreCommit Python Dataframes

# 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 Python Dataframes
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python_Dataframes.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "model/**","sdks/python/**","release/**",".github/workflows/beam_PreCommit_Python_Dataframes.yml"]
  schedule:
    - cron: '45 2/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: 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.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_Python_Dataframes:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase}} ${{ matrix.python_version}})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    strategy:
      fail-fast: false
      matrix:
        job_name: ['beam_PreCommit_Python_Dataframes']
        job_phrase: ['Run Python_Dataframes PreCommit']
        python_version: ['3.8','3.9','3.10','3.11','3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      startsWith(github.event.comment.body, 'Run Python_Dataframes PreCommit')
    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 pythonPreCommit
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:tox:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:preCommitPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}
          arguments: |
            -Pposargs=apache_beam/dataframe/ \
            -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'


PreCommit Python Examples

# 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 Python Examples
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python_Examples.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "model/**","sdks/python/**","release/**",".github/workflows/beam_PreCommit_Python_Examples.yml"]
  schedule:
    - cron: '45 2/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: 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.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_Python_Examples:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    strategy:
      fail-fast: false
      matrix:
        job_name: ['beam_PreCommit_Python_Examples']
        job_phrase: ['Run Python_Examples PreCommit']
        python_version: ['3.8','3.9','3.10','3.11','3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      startsWith(github.event.comment.body, 'Run Python_Examples PreCommit')
    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 pythonPreCommit
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:tox:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:preCommitPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}
          arguments: |
            -Pposargs=apache_beam/examples/ \
            -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'


PreCommit Python Integration

# 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 Python Integration
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: ["model/**", "sdks/python/**", "release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python_Integration.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ["model/**", "sdks/python/**", "release/**", ".github/workflows/beam_PreCommit_Python_Integration.yml"]
  schedule:
    - cron: '45 2/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: 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.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_Python_Integration:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    strategy:
      fail-fast: false
      matrix:
        job_name: ['beam_PreCommit_Python_Integration']
        job_phrase: ['Run Python_Integration PreCommit']
        python_version: ['3.8', '3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      startsWith(github.event.comment.body, 'Run Python_Integration PreCommit')
    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 Python Integration PreCommit batch 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}}:preCommitIT_batch
          arguments: |
            -PuseWheelDistribution \
            -PpythonVersion=${{ matrix.python_version }} \
      - name: run Python Integration PreCommit streaming 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}}:preCommitIT_streaming
          arguments: |
            -PuseWheelDistribution \
            -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'


# 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 Python ML tests with ML deps installed
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python_ML.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "model/**","sdks/python/**","release/**",".github/workflows/beam_PreCommit_Python_ML.yml"]
  schedule:
    - cron: '45 2/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: 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.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_Python_ML:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    strategy:
      fail-fast: false
      matrix:
        job_name: ['beam_PreCommit_Python_ML']
        job_phrase: ['Run Python_ML PreCommit']
        python_version: ['3.8','3.9','3.10','3.11','3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      startsWith(github.event.comment.body, 'Run Python_ML PreCommit')
    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 pythonPreCommit
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:tox:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:testPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}ML
          arguments: |
            -Pposargs=apache_beam/ml/ \
            -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'


PreCommit Python PVR 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: PreCommit Python PVR Flink

on:
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - 'model/**'
      - 'sdks/python/**'
      - 'release/**'
      - 'sdks/java/io/kafka/**'
      - 'runners/core-construction-java/**'
      - 'runners/core-java/**'
      - 'runners/extensions-java/**'
      - 'runners/flink/**'
      - 'runners/java-fn-execution/**'
      - 'runners/reference/**'
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Python_PVR_Flink.json'
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - 'model/**'
      - 'sdks/python/**'
      - 'release/**'
      - 'sdks/java/io/kafka/**'
      - 'runners/core-construction-java/**'
      - 'runners/core-java/**'
      - 'runners/extensions-java/**'
      - 'runners/flink/**'
      - 'runners/java-fn-execution/**'
      - 'runners/reference/**'
      - '.github/workflows/beam_PreCommit_Python_PVR_Flink.yml'
  schedule:
    - cron: '45 2/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: 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.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_Python_PVR_Flink:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Python_PVR_Flink"]
        job_phrase: ["Run Python_PVR_Flink 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 Python_PVR_Flink PreCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    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 Python PVR Flink PreCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        with:
          gradle-command: :sdks:python:test-suites:portable:py312:flinkValidatesRunner
          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'


PreCommit Python Runners

# 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 Python Runners
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python_Runners.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "model/**","sdks/python/**","release/**",".github/workflows/beam_PreCommit_Python_Runners.yml"]
  schedule:
    - cron: '45 2/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: 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.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_Python_Runners:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    strategy:
      fail-fast: false
      matrix:
        job_name: ['beam_PreCommit_Python_Runners']
        job_phrase: ['Run Python_Runners PreCommit']
        python_version: ['3.8','3.9','3.10','3.11','3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      startsWith(github.event.comment.body, 'Run Python_Runners PreCommit')
    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 pythonPreCommit
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:tox:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:preCommitPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}
          arguments: |
            -Pposargs=apache_beam/runners/ \
            -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'


PreCommit Python Transforms

# 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 Python Transforms
on:
  pull_request_target:
    branches: [ "master", "release-*" ]
    paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python_Transforms.json']
  issue_comment:
    types: [created]
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: [ "model/**","sdks/python/**","release/**",".github/workflows/beam_PreCommit_Python_Transforms.yml"]
  schedule:
    - cron: '45 2/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: 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.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_Python_Transforms:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 180
    strategy:
      fail-fast: false
      matrix:
        job_name: ['beam_PreCommit_Python_Transforms']
        job_phrase: ['Run Python_Transforms PreCommit']
        python_version: ['3.8','3.9','3.10','3.11','3.12']
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      startsWith(github.event.comment.body, 'Run Python_Transforms PreCommit')
    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 pythonPreCommit
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:test-suites:tox:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:preCommitPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}
          arguments: |
            -Pposargs=apache_beam/transforms/ \
            -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'


PreCommit RAT

# 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 RAT

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
  pull_request_target:
    branches: ['master', 'release-*']
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 3/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_RAT:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_RAT]
        job_phrase: [Run RAT 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 RAT 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 RAT script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :rat


PreCommit 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: PreCommit SQL

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ['sdks/java/extensions/sql/**','.github/workflows/beam_PreCommit_SQL.yml']
  pull_request_target:
    branches: ['master', 'release-*']
    paths: ['sdks/java/extensions/sql/**', 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_SQL.json']
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 3/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_SQL:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_SQL]
        job_phrase: [Run SQL 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 SQL 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: 11
      - name: Build and Test
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sqlPreCommit
          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: Set Jacoco report path
        id: jacoco_report_path
        run: |
          echo "path=sdks/java/extensions/sql/build/reports/jacoco/test/jacocoTestReport.xml" >> $GITHUB_OUTPUT
      - 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:
          file: ${{ steps.jacoco_report_path.outputs.path }}
          flags: java


PreCommit SQL Java11

# 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 SQL Java11

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ['sdks/java/extensions/sql/**','.github/workflows/beam_PreCommit_SQL_Java11.yml']
  pull_request_target:
    branches: ['master', 'release-*']
    paths: ['sdks/java/extensions/sql/**', 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_SQL_Java11.json']
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 3/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_SQL_Java11:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_SQL_Java11]
        job_phrase: [Run SQL_Java11 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 SQL_Java11 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: 11
          python-version: default
          go-version: default
      - name: Install Flutter
        uses: subosito/flutter-action@v2
        with:
          flutter-version: '3.10.4'
          channel: 'stable'
      - name: Build and Test
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:extensions:sql:preCommit
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
            -PtestJavaVersion=11 \
            -PskipCheckerFramework \
            -Pjava11Home=$JAVA_HOME_11_X64 \
      - 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'


PreCommit SQL Java17

# 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 SQL Java17

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths: ['sdks/java/extensions/sql/**','.github/workflows/beam_PreCommit_SQL_Java17.yml']
  pull_request_target:
    branches: ['master', 'release-*']
    paths: ['sdks/java/extensions/sql/**', 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_SQL_Java17.json']
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 3/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: 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.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_SQL_Java17:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_SQL_Java17"]
        job_phrase: ["Run SQL_Java17 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 SQL_Java17 PreCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    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 }})
# The test requires Java 17 and Java 8 versions.
# Java 8 is installed second because JAVA_HOME needs to point to Java 8.
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          java-version: |
            17
            8
          python-version: default
      - name: Build and Test
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:extensions:sql:preCommit
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
            -PtestJavaVersion=17 \
            -PskipCheckerFramework \
            -Pjava17Home=$JAVA_HOME_17_X64 \
      - 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'