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

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/influxdb/**"
      - ".github/workflows/beam_PreCommit_Java_InfluxDb_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/influxdb/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_InfluxDb_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '45 1/6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: 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_InfluxDb_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_InfluxDb_IO_Direct"]
        job_phrase: ["Run Java_InfluxDb_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_InfluxDb_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 InfluxDb IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:influxdb: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 JDBC 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 JDBC IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/jdbc/**"
      - ".github/workflows/beam_PreCommit_Java_JDBC_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/jdbc/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_JDBC_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '45 1/6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: 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_JDBC_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_JDBC_IO_Direct"]
        job_phrase: ["Run Java_JDBC_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_JDBC_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 JDBC IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:jdbc:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - name: run JDBC IO IT script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:jdbc:integrationTest
          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 Jms 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 Jms IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/jms/**"
      - ".github/workflows/beam_PreCommit_Java_Jms_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/jms/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Jms_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '45 1/6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: 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_Jms_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Jms_IO_Direct"]
        job_phrase: ["Run Java_Jms_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_Jms_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 Jms IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:jms:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - name: run Jms IO IT script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:jms:integrationTest
          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 Kafka 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 Kafka IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/kafka/**"
      - "sdks/java/testing/test-utils/**"
      - "sdks/java/expansion-service/**"
      - "sdks/java/io/synthetic/**"
      - "sdks/java/io/expansion-service/**"
      - ".github/workflows/beam_PreCommit_Java_Kafka_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/kafka/**"
      - "sdks/java/testing/test-utils/**"
      - "sdks/java/expansion-service/**"
      - "sdks/java/io/synthetic/**"
      - "sdks/java/io/expansion-service/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Kafka_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '45 1/6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: 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_Kafka_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Kafka_IO_Direct"]
        job_phrase: ["Run Java_Kafka_IO_Direct PreCommit"]
    timeout-minutes: 120
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run Java_Kafka_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 Kafka IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:kafka:build :sdks:java:io:kafka:kafkaVersionsCompatibilityTest :sdks:java:io:kafka:upgrade:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
            --no-parallel \
      - 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 Kinesis 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 Kinesis IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/kinesis/**"
      - "sdks/java/io/common/**"
      - "sdks/java/core/src/main/**"
      - "build.gradle"
      - "buildSrc/**"
      - "gradle/**"
      - "gradle.properties"
      - "gradlew"
      - "gradle.bat"
      - "settings.gradle.kts"
      - ".github/workflows/beam_PreCommit_Java_Kinesis_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/kinesis/**"
      - "sdks/java/io/common/**"
      - "sdks/java/core/src/main/**"
      - "build.gradle"
      - "buildSrc/**"
      - "gradle/**"
      - "gradle.properties"
      - "gradlew"
      - "gradle.bat"
      - "settings.gradle.kts"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Kinesis_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 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_Kinesis_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Kinesis_IO_Direct"]
        job_phrase: ["Run Java_Kinesis_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_Kinesis_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 Kinesis IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:kinesis:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - name: run Kinesis expansion service script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:kinesis:expansion-service:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - name: run Kinesis IO IT script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:kinesis:integrationTest
          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 Kudu 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 Kudu IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/kudu/**"
      - ".github/workflows/beam_PreCommit_Java_Kudu_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/kudu/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Kudu_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 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_Kudu_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Kudu_IO_Direct"]
        job_phrase: ["Run Java_Kudu_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_Kudu_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 Kudu IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:kudu: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 MongoDb 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 MongoDb IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/mongodb/**"
      - ".github/workflows/beam_PreCommit_Java_MongoDb_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/mongodb/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_MongoDb_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 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_MongoDb_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_MongoDb_IO_Direct"]
        job_phrase: ["Run Java_MongoDb_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_MongoDb_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 MongoDb IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:mongodb: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 Mqtt 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 Mqtt IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/mqtt/**"
      - ".github/workflows/beam_PreCommit_Java_Mqtt_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/mqtt/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Mqtt_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 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_Mqtt_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Mqtt_IO_Direct"]
        job_phrase: ["Run Java_Mqtt_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_Mqtt_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 Mqtt IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:mqtt: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 Neo4j 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 Neo4j IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/neo4j/**"
      - "sdks/java/testing/test-utils/**"
      - ".github/workflows/beam_PreCommit_Java_Neo4j_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/neo4j/**"
      - "sdks/java/testing/test-utils/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Neo4j_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 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_Neo4j_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: [ "beam_PreCommit_Java_Neo4j_IO_Direct" ]
        job_phrase: ["Run Java_Neo4j_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_Neo4j_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 Neo4j IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:neo4j:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - name: run Neo4j IO IT script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:neo4j:integrationTest
          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 PVR Flink Batch

# 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 PVR Flink Batch

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - 'runners/flink/**'
      - 'runners/java-fn-execution/**'
      - 'sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/**'
      - '.github/workflows/beam_PreCommit_Java_PVR_Flink_Batch.yml'
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - 'runners/flink/**'
      - 'runners/java-fn-execution/**'
      - 'sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/**'
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_PVR_Flink_Batch.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 2/6 * * *'
  workflow_dispatch:

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

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

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

jobs:
  beam_PreCommit_Java_PVR_Flink_Batch:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_PVR_Flink_Batch"]
        job_phrase: ["Run Java_PVR_Flink_Batch PreCommit"]
    timeout-minutes: 240
    runs-on: [self-hosted, ubuntu-20.04, highmem]
    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_PVR_Flink_Batch PreCommit'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: run validatesPortableRunnerBatch script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:flink:1.15:job-server:validatesPortableRunnerBatch
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH }}
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Upload test report
        uses: actions/upload-artifact@v4
        with:
          name: java-code-coverage-report
          path: "**/build/test-results/**/*.xml"
# TODO: Investigate 'Max retries exceeded' issue with EnricoMi/publish-unit-test-result-action@v2.


PreCommit Java PVR Flink 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 Java PVR Flink Docker

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - 'sdks/java/core/src/test/java/org/apache/beam/sdk/**'
      - 'sdks/java/container/**'
      - 'sdks/java/harness/**'
      - 'runners/flink/**'
      - 'runners/java-fn-execution/**'
      - '.github/workflows/beam_PreCommit_Java_PVR_Flink_Docker.yml'
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - 'sdks/java/core/src/test/java/org/apache/beam/sdk/**'
      - 'sdks/java/container/**'
      - 'sdks/java/harness/**'
      - 'runners/flink/**'
      - 'runners/java-fn-execution/**'
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_PVR_Flink_Docker.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 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_PVR_Flink_Docker:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      fail-fast: false
      matrix:
        job_name: [ beam_PreCommit_Java_PVR_Flink_Docker ]
        job_phrase: [ Run Java_PVR_Flink_Docker 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 Java_PVR_Flink_Docker PreCommit'
    timeout-minutes: 240
    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 PreCommit Java PVR Flink Docker script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:flink:1.15:job-server:validatesPortableRunnerDocker
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


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

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/parquet/**"
      - ".github/workflows/beam_PreCommit_Java_Parquet_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/parquet/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Parquet_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 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_Parquet_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Parquet_IO_Direct"]
        job_phrase: ["Run Java_Parquet_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_Parquet_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 Parquet IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:parquet: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 Pulsar 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 Pulsar IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/pulsar/**"
      - "sdks/java/io/common/**"
      - "sdks/java/core/src/main/**"
      - "build.gradle"
      - "buildSrc/**"
      - "gradle/**"
      - "gradle.properties"
      - "gradlew"
      - "gradle.bat"
      - "settings.gradle.kts"
      - ".github/workflows/beam_PreCommit_Java_Pulsar_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/pulsar/**"
      - "sdks/java/io/common/**"
      - "sdks/java/core/src/main/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Pulsar_IO_Direct.json'
      - "build.gradle"
      - "buildSrc/**"
      - "gradle/**"
      - "gradle.properties"
      - "gradlew"
      - "gradle.bat"
      - "settings.gradle.kts"
  issue_comment:
    types: [created]
  schedule:
    - cron: '0 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_Pulsar_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Pulsar_IO_Direct"]
        job_phrase: ["Run Java_Pulsar_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_Pulsar_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 Pulsar IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:pulsar: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 RabbitMq 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 RabbitMq IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/rabbitmq/**"
      - ".github/workflows/beam_PreCommit_Java_RabbitMq_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/rabbitmq/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_RabbitMq_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 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_RabbitMq_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_RabbitMq_IO_Direct"]
        job_phrase: ["Run Java_RabbitMq_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_RabbitMq_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 RabbitMq IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:rabbitmq: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 Redis 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 Redis IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/redis/**"
      - ".github/workflows/beam_PreCommit_Java_Redis_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/redis/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Redis_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 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_Redis_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Redis_IO_Direct"]
        job_phrase: ["Run Java_Redis_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_Redis_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 Redis IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:redis: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'


# 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 RequestResponse IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
    - "sdks/java/io/rrio/**"
    - ".github/workflows/beam_PreCommit_Java_RequestResponse_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
    - "sdks/java/io/rrio/**"
    - 'release/trigger_all_tests.json'
    - '.github/trigger_files/beam_PreCommit_Java_RequestResponse_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
  - cron: '0 */6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: 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_RequestResponse_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_RequestResponse_IO_Direct"]
        job_phrase: ["Run Java_RequestResponse_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_RequestResponse_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: run RequestResponse IO build script
      uses: ./.github/actions/gradle-command-self-hosted-action
      with:
        gradle-command: :sdks:java:io:rrio: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 SingleStore 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 SingleStore IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/singlestore/**"
      - "sdks/java/testing/test-utils/**"
      - ".github/workflows/beam_PreCommit_Java_SingleStore_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/singlestore/**"
      - "sdks/java/testing/test-utils/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_SingleStore_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 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_SingleStore_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_SingleStore_IO_Direct"]
        job_phrase: ["Run Java_SingleStore_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_SingleStore_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 SingleStore IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:singlestore: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 Snowflake 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 Snowflake IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/snowflake/**"
      - "sdks/java/extensions/google-cloud-platform-core/**"
      - "sdks/java/testing/test-utils/**"
      - ".github/workflows/beam_PreCommit_Java_Snowflake_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/snowflake/**"
      - "sdks/java/extensions/google-cloud-platform-core/**"
      - "sdks/java/testing/test-utils/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Snowflake_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 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_Snowflake_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Snowflake_IO_Direct"]
        job_phrase: ["Run Java_Snowflake_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_Snowflake_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 Snowflake IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:snowflake:build
          arguments: |
            -PdisableSpotlessCheck=true \
            -PdisableCheckStyle=true \
      - name: run Snowflake expansion service script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:snowflake:expansion-service: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 Solace 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 Solace IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
    - "sdks/java/io/solace/**"
    - ".github/workflows/beam_PreCommit_Java_Solace_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
    - "sdks/java/io/solace/**"
    - 'release/trigger_all_tests.json'
    - '.github/trigger_files/beam_PreCommit_Java_Solace_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
  - cron: '45 1/6 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: 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_Solace_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Solace_IO_Direct"]
        job_phrase: ["Run Java_Solace_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_Solace_IO_Direct PreCommit'
    runs-on: ubuntu-20.04
    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 Solace IO build script
      uses: ./.github/actions/gradle-command-self-hosted-action
      with:
        gradle-command: :sdks:java:io:solace:build
        arguments: |
          -PdisableSpotlessCheck=true \
          -PdisableCheckStyle=true \
    - name: run Solace IO IT script
      uses: ./.github/actions/gradle-command-self-hosted-action
      with:
        gradle-command: :sdks:java:io:solace:integrationTest
        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 Solr 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 Solr IO Direct

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/solr/**"
      - ".github/workflows/beam_PreCommit_Java_Solr_IO_Direct.yml"
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - "sdks/java/io/solr/**"
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Solr_IO_Direct.json'
  issue_comment:
    types: [created]
  schedule:
    - cron: '15 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_Solr_IO_Direct:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PreCommit_Java_Solr_IO_Direct"]
        job_phrase: ["Run Java_Solr_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_Solr_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 Solr IO build script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:solr: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 Spark3 Versions

# 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 Spark3 Versions

on:
  push:
    tags: ['v*']
    branches: ['master', 'release-*']
    paths:
      - 'runners/spark/**'
      - '.github/workflows/beam_PreCommit_Java_Spark3_Versions.yml'
  pull_request_target:
    branches: ['master', 'release-*']
    paths:
      - 'runners/spark/**'
      - 'release/trigger_all_tests.json'
      - '.github/trigger_files/beam_PreCommit_Java_Spark3_Versions.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: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

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

jobs:
  beam_PreCommit_Java_Spark3_Versions:
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    runs-on: [self-hosted, ubuntu-20.04, main]
    strategy:
      matrix:
        job_name: [beam_PreCommit_Java_Spark3_Versions]
        job_phrase: [Run Java_Spark3_Versions PreCommit]
    timeout-minutes: 120
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run Java_Spark3_Versions 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 sparkVersionsTest script
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :runners:spark:3:sparkVersionsTest
          arguments: -PdisableSpotlessCheck=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'