andreydevyatkin commented on code in PR #27721: URL: https://github.com/apache/beam/pull/27721#discussion_r1277701110
########## .github/workflows/beam_PreCommit_Java_Flink.yml: ########## @@ -0,0 +1,94 @@ +# 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: Java Flink Runner PreCommit + +on: + push: + tags: ['v*'] + branches: ['master', 'release-*'] + paths: + - 'model/**' + - 'runners/flink/**' + - 'release/**' + - '.github/workflows/beam_PreCommit_Java_Flink.yml' + pull_request_target: + branches: ['master', 'release-*'] + paths: + - 'model/**' + - 'runners/flink/**' + - 'release/**' + issue_comment: + types: [created] + schedule: + - cron: '20 */6 * * *' Review Comment: What is the intention to run the workflow exactly at the 20th minute? ########## .github/workflows/beam_PreCommit_Java_Flink.yml: ########## @@ -0,0 +1,94 @@ +# 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: Java Flink Runner PreCommit + +on: + push: + tags: ['v*'] + branches: ['master', 'release-*'] + paths: + - 'model/**' + - 'runners/flink/**' + - 'release/**' + - '.github/workflows/beam_PreCommit_Java_Flink.yml' + pull_request_target: + branches: ['master', 'release-*'] + paths: + - 'model/**' + - 'runners/flink/**' + - 'release/**' + issue_comment: + types: [created] + schedule: + - cron: '20 */6 * * *' + workflow_dispatch: + +permissions: + actions: write + pull-requests: read + checks: read + contents: read + deployments: read + id-token: none + issues: read + discussions: read + packages: read + pages: read + repository-projects: read + security-events: read + statuses: read + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.sender.login }}-${{ github.event.schedule }}' + cancel-in-progress: true + +jobs: + beam_PreCommit_Java_Flink: + if: | + github.event_name == 'push' || + github.event_name == 'pull_request_target' || + github.event_name == 'schedule' || + github.event.comment.body == 'Run Java_Flink PreCommit' + runs-on: [self-hosted, ubuntu-20.04, main] + name: beam_PreCommit_Java_Flink (Run Java_Flink PreCommit) + steps: + - name: Git checkout + uses: actions/checkout@v3 + - name: Rerun on comment + if: github.event.comment.body == 'Run Java_Flink PreCommit' + uses: ./.github/actions/rerun-job-action + with: + pull_request_url: ${{ github.event.issue.pull_request.url }} + github_repository: ${{ github.repository }} + github_token: ${{ secrets.GITHUB_TOKEN }} + github_job: ${{ github.job }} + github_current_run_id: ${{ github.run_id }} + - name: Install Java + uses: actions/[email protected] + with: + distribution: 'zulu' + java-version: '8' + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + - name: run Java Flink PreCommit script + run: ./gradlew :flinkPreCommit Review Comment: We should use the gradle action to run the task in order to add the required params - https://github.com/apache/beam/blob/master/.github/actions/gradle-command-self-hosted-action/action.yml#L48-L49 ########## .github/workflows/beam_PreCommit_Java_Flink.yml: ########## @@ -0,0 +1,94 @@ +# 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: Java Flink Versions PreCommit + +on: + push: + tags: ['v*'] + branches: ['master', 'release-*'] + paths: + - 'model/**' + - 'runners/flink/**' + - 'release/**' + - '.github/workflows/beam_PreCommit_Java_Flink_Versions.yml' + pull_request_target: + branches: ['master', 'release-*'] + paths: + - 'model/**' + - 'runners/flink/**' + - 'release/**' + issue_comment: + types: [created] + schedule: + - cron: '20 */6 * * *' + workflow_dispatch: + +permissions: + actions: write + pull-requests: read + checks: read + contents: read + deployments: read + id-token: none + issues: read + discussions: read + packages: read + pages: read + repository-projects: read + security-events: read + statuses: read + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.sender.login }}-${{ github.event.schedule }}' + cancel-in-progress: true + +jobs: + beam_PreCommit_Java_Flink_Versions: + if: | + github.event_name == 'push' || + github.event_name == 'pull_request_target' || + github.event_name == 'schedule' || + github.event.comment.body == 'Run Java_Flink_Versions PreCommit' + runs-on: [self-hosted, ubuntu-20.04, main] + name: beam_PreCommit_Java_Flink_Versions (Run Java_Flink_Versions PreCommit) + steps: + - name: Git checkout + uses: actions/checkout@v3 Review Comment: This step should use `ref` as per the README file - https://github.com/apache/beam/blob/master/.github/ACTIONS.md?plain=1#L65-L68. However, it should probably be different for the `issue_comment` event due to the [issue](https://github.com/apache/beam/issues/27715) (the fix is on my plate) ########## .github/workflows/beam_PreCommit_Java_Flink.yml: ########## @@ -0,0 +1,94 @@ +# 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: Java Flink Runner PreCommit Review Comment: Can we put `PreCommit` at the beginning of the workflow name? The intention is to keep and list all `PreCommit` workflow files together -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
