|
| 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 Examples Dataflow ARM |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + tags: ['v*'] |
| 23 | + branches: ['master', 'release-*'] |
| 24 | + paths: |
| 25 | + - 'model/**' |
| 26 | + - 'sdks/java/**' |
| 27 | + - 'runners/google-cloud-dataflow-java/**' |
| 28 | + - 'examples/java/**' |
| 29 | + - 'examples/kotlin/**' |
| 30 | + - 'release/**' |
| 31 | + - '.github/workflows/beam_PostCommit_Java_Examples_Dataflow_ARM.yml' |
| 32 | + issue_comment: |
| 33 | + types: [created] |
| 34 | + schedule: |
| 35 | + - cron: '0 */6 * * *' |
| 36 | + workflow_dispatch: |
| 37 | + |
| 38 | +# This allows a subsequently queued workflow run to interrupt previous runs |
| 39 | +concurrency: |
| 40 | + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.sender.login }}-${{ github.event.schedule }}' |
| 41 | + cancel-in-progress: true |
| 42 | + |
| 43 | +#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event |
| 44 | +permissions: |
| 45 | + actions: write |
| 46 | + pull-requests: read |
| 47 | + checks: read |
| 48 | + contents: read |
| 49 | + deployments: read |
| 50 | + id-token: none |
| 51 | + issues: read |
| 52 | + discussions: read |
| 53 | + packages: read |
| 54 | + pages: read |
| 55 | + repository-projects: read |
| 56 | + security-events: read |
| 57 | + statuses: read |
| 58 | + |
| 59 | +env: |
| 60 | + TAG: $(date +'%Y%m%d-%H%M%S%N') |
| 61 | + |
| 62 | +jobs: |
| 63 | + beam_PostCommit_Java_Examples__Dataflow_ARM: |
| 64 | + name: beam_PostCommit_Java_Examples__Dataflow_ARM (Run Java_Examples_Dataflow_ARM PostCommit) |
| 65 | + runs-on: [self-hosted, ubuntu-20.04, main] |
| 66 | + strategy: |
| 67 | + fail-fast: false |
| 68 | + if: | |
| 69 | + github.event_name == 'push' || |
| 70 | + github.event_name == 'schedule' || |
| 71 | + github.event.comment.body == 'Run Java_Examples_Dataflow_ARM PostCommit' || |
| 72 | + github. event_name == 'workflow_dispatch' |
| 73 | + steps: |
| 74 | + - name: Check out repository code |
| 75 | + uses: actions/checkout@v3 |
| 76 | + with: |
| 77 | + ref: ${{ github.event.pull_request.head.sha }} |
| 78 | + - name: Rerun on comment |
| 79 | + if: github.event.comment.body == 'Run Java_Examples_Dataflow_ARM PostCommit' |
| 80 | + uses: ./.github/actions/rerun-job-action |
| 81 | + with: |
| 82 | + pull_request_url: ${{ github.event.issue.pull_request.url }} |
| 83 | + github_repository: ${{ github.repository }} |
| 84 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + github_job: "beam_PostCommit_Java_Examples__Dataflow_ARM (Run Java_Examples_Dataflow_ARM PostCommit)" |
| 86 | + github_current_run_id: ${{ github.run_id }} |
| 87 | + - name: Setup self-hosted |
| 88 | + uses: ./.github/actions/setup-self-hosted-action |
| 89 | + with: |
| 90 | + requires-py-38: false |
| 91 | + requires-py-39: false |
| 92 | + requires-go: false |
| 93 | + - name: Setup Gradle |
| 94 | + uses: gradle/gradle-build-action@v2 |
| 95 | + with: |
| 96 | + cache-read-only: false |
| 97 | + - name: Set up Docker Buildx |
| 98 | + uses: docker/setup-buildx-action@v2 |
| 99 | + - name: Authenticate on GCP |
| 100 | + id: auth |
| 101 | + uses: google-github-actions/setup-gcloud@v0 |
| 102 | + with: |
| 103 | + service_account_email: ${{ secrets.GCP_SA_EMAIL }} |
| 104 | + service_account_key: ${{ secrets.GCP_SA_KEY }} |
| 105 | + project_id: ${{ secrets.GCP_PROJECT_ID }} |
| 106 | + export_default_credentials: true |
| 107 | + - name: GCloud Docker credential helper |
| 108 | + run: | |
| 109 | + gcloud auth configure-docker us.gcr.io |
| 110 | + - name: run javaExamplesDataflowARMPostCommit script for Java8 |
| 111 | + uses: ./.github/actions/gradle-command-self-hosted-action |
| 112 | + with: |
| 113 | + gradle-command: :runners:google-cloud-dataflow-java:arm:examplesJavaRunnerV2IntegrationTestARM |
| 114 | + arguments: | |
| 115 | + -Pcontainer-architecture-list=arm64,amd64 \ |
| 116 | + -Ppush-containers \ |
| 117 | + -Pdocker-repository-root=us.gcr.io/apache-beam-testing/java-postcommit-it/arm \ |
| 118 | + -Pdocker-tag=${{env.TAG}} \ |
| 119 | + - name: run javaExamplesDataflowARMPostCommit script for Java11 |
| 120 | + uses: ./.github/actions/gradle-command-self-hosted-action |
| 121 | + with: |
| 122 | + gradle-command: :runners:google-cloud-dataflow-java:arm:examplesJavaRunnerV2IntegrationTestARM |
| 123 | + arguments: | |
| 124 | + -PcompileAndRunTestsWithJava11 \ |
| 125 | + -Pcontainer-architecture-list=arm64,amd64 \ |
| 126 | + -Ppush-containers \ |
| 127 | + -Pdocker-repository-root=us.gcr.io/apache-beam-testing/java-postcommit-it/arm \ |
| 128 | + -Pdocker-tag=${{env.TAG}} \ |
| 129 | + - name: run javaExamplesDataflowARMPostCommit script for Java17 |
| 130 | + uses: ./.github/actions/gradle-command-self-hosted-action |
| 131 | + with: |
| 132 | + gradle-command: :runners:google-cloud-dataflow-java:arm:examplesJavaRunnerV2IntegrationTestARM |
| 133 | + arguments: | |
| 134 | + -PcompileAndRunTestsWithJava17 \ |
| 135 | + -Pcontainer-architecture-list=arm64,amd64 \ |
| 136 | + -Ppush-containers \ |
| 137 | + -Pdocker-repository-root=us.gcr.io/apache-beam-testing/java-postcommit-it/arm \ |
| 138 | + -Pdocker-tag=${{env.TAG}} \ |
| 139 | + - name: Upload test report |
| 140 | + uses: actions/upload-artifact@v3 |
| 141 | + with: |
| 142 | + name: java-code-coverage-report |
| 143 | + path: "**/build/test-results/**/*.xml" |
0 commit comments