|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +name: PostCommit Java ValidatesDistrolessContainer Dataflow |
| 19 | + |
| 20 | +on: |
| 21 | + schedule: |
| 22 | + - cron: '30 6/8 * * *' |
| 23 | + pull_request_target: |
| 24 | + paths: |
| 25 | + - 'release/trigger_all_tests.json' |
| 26 | + - '.github/trigger_files/beam_PostCommit_Java_ValidatesRunner_Dataflow_V2.json' |
| 27 | + - '.github/trigger_files/beam_PostCommit_Java_ValidatesDistrolessContainer_Dataflow.json' |
| 28 | + |
| 29 | + workflow_dispatch: |
| 30 | + |
| 31 | +# This allows a subsequently queued workflow run to interrupt previous runs |
| 32 | +concurrency: |
| 33 | + group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}' |
| 34 | + cancel-in-progress: true |
| 35 | + |
| 36 | +#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event |
| 37 | +permissions: |
| 38 | + actions: write |
| 39 | + pull-requests: write |
| 40 | + checks: write |
| 41 | + contents: read |
| 42 | + deployments: read |
| 43 | + id-token: none |
| 44 | + issues: write |
| 45 | + discussions: read |
| 46 | + packages: read |
| 47 | + pages: read |
| 48 | + repository-projects: read |
| 49 | + security-events: read |
| 50 | + statuses: read |
| 51 | + |
| 52 | +env: |
| 53 | + DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} |
| 54 | + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }} |
| 55 | + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }} |
| 56 | + |
| 57 | +jobs: |
| 58 | + beam_PostCommit_Java_ValidatesDistrolessContainer_Dataflow: |
| 59 | + name: ${{ matrix.job_name }} (${{ matrix.job_phrase }}) |
| 60 | + runs-on: [self-hosted, ubuntu-20.04, main] |
| 61 | + timeout-minutes: 390 |
| 62 | + strategy: |
| 63 | + matrix: |
| 64 | + job_name: [beam_PostCommit_Java_ValidatesDistrolessContainer_Dataflow] |
| 65 | + job_phrase: [Run Java Dataflow ValidatesDistrolessContainer] |
| 66 | + if: | |
| 67 | + github.event_name == 'workflow_dispatch' || |
| 68 | + github.event_name == 'pull_request_target' || |
| 69 | + (github.event_name == 'schedule' && github.repository == 'apache/beam') || |
| 70 | + github.event.comment.body == 'Run Java Dataflow ValidatesDistrolessContainer' |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v4 |
| 73 | + - name: Setup repository |
| 74 | + uses: ./.github/actions/setup-action |
| 75 | + with: |
| 76 | + comment_phrase: ${{ matrix.job_phrase }} |
| 77 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 78 | + github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }}) |
| 79 | + - name: Setup environment |
| 80 | + uses: ./.github/actions/setup-environment-action |
| 81 | + with: |
| 82 | + java-version: | |
| 83 | + 17 |
| 84 | + 21 |
| 85 | + - name: Setup docker |
| 86 | + run: | |
| 87 | + gcloud auth configure-docker us-docker.pkg.dev --quiet |
| 88 | + gcloud auth configure-docker us.gcr.io --quiet |
| 89 | + gcloud auth configure-docker gcr.io --quiet |
| 90 | + gcloud auth configure-docker us-central1-docker.pkg.dev --quiet |
| 91 | + - name: run validatesDistrolessContainer script |
| 92 | + uses: ./.github/actions/gradle-command-self-hosted-action |
| 93 | + with: |
| 94 | + gradle-command: :runners:google-cloud-dataflow-java:examplesJavaRunnerV2IntegrationTestDistroless |
| 95 | + max-workers: 12 |
| 96 | + - name: Archive JUnit Test Results |
| 97 | + uses: actions/upload-artifact@v4 |
| 98 | + if: ${{ !success() }} |
| 99 | + with: |
| 100 | + name: JUnit Test Results |
| 101 | + path: "**/build/reports/tests/" |
| 102 | + - name: Publish JUnit Test Results |
| 103 | + uses: EnricoMi/publish-unit-test-result-action@v2 |
| 104 | + if: always() |
| 105 | + with: |
| 106 | + commit: '${{ env.prsha || env.GITHUB_SHA }}' |
| 107 | + comment_mode: ${{ github.event_name == 'issue_comment' && 'always' || 'off' }} |
| 108 | + files: '**/build/test-results/**/*.xml' |
0 commit comments