1+ # Licensed to the Apache Software Foundation (ASF) under one or more
2+ # contributor license agreements. See the NOTICE file distributed with
3+ # this work for additional information regarding copyright ownership.
4+ # The ASF licenses this file to You under the Apache License, Version 2.0
5+ # (the "License"); you may not use this file except in compliance with
6+ # the License. You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+
16+ name : PostCommit Python ValidatesRunner Dataflow
17+
18+ on :
19+ issue_comment :
20+ types : [created]
21+ schedule :
22+ - cron : ' 0 */6 * * *'
23+ workflow_dispatch :
24+
25+ # Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
26+ permissions :
27+ actions : write
28+ pull-requests : read
29+ checks : read
30+ contents : read
31+ deployments : read
32+ id-token : none
33+ issues : read
34+ discussions : read
35+ packages : read
36+ pages : read
37+ repository-projects : read
38+ security-events : read
39+ statuses : read
40+
41+ # This allows a subsequently queued workflow run to interrupt previous runs
42+ concurrency :
43+ 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.body || github.event.sender.login}}'
44+ cancel-in-progress : true
45+
46+ env :
47+ GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
48+ GRADLE_ENTERPRISE_CACHE_USERNAME : ${{ secrets.GE_CACHE_USERNAME }}
49+ GRADLE_ENTERPRISE_CACHE_PASSWORD : ${{ secrets.GE_CACHE_PASSWORD }}
50+
51+ jobs :
52+ beam_PostCommit_Python_ValidatesRunner_Dataflow :
53+ if : |
54+ github.event_name == 'schedule' ||
55+ github.event_name == 'workflow_dispatch' ||
56+ startsWith(github.event.comment.body, 'Run Python Dataflow ValidatesRunner')
57+ runs-on : [self-hosted, ubuntu-20.04, main]
58+ timeout-minutes : 200
59+ name : ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
60+ strategy :
61+ fail-fast : false
62+ matrix :
63+ job_name : ["beam_PostCommit_Python_ValidatesRunner_Dataflow"]
64+ job_phrase : ["Run Python Dataflow ValidatesRunner"]
65+ python_version : ['3.8', '3.11']
66+ steps :
67+ - uses : actions/checkout@v3
68+ - name : Setup repository
69+ uses : ./.github/actions/setup-action
70+ with :
71+ comment_phrase : ${{ matrix.job_phrase }} ${{ matrix.python_version }}
72+ github_token : ${{ secrets.GITHUB_TOKEN }}
73+ github_job : ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
74+ - name : Install Python
75+ uses : actions/setup-python@v4
76+ with :
77+ python-version : ${{ matrix.python_version }}
78+ - name : Install Java
79+ uses : actions/setup-java@v3
80+ with :
81+ distribution : ' zulu'
82+ java-version : ' 8'
83+ - name : Setup Gradle
84+ uses : gradle/gradle-build-action@v2
85+ with :
86+ cache-read-only : false
87+ - name : Set PY_VER_CLEAN
88+ id : set_py_ver_clean
89+ run : |
90+ PY_VER=${{ matrix.python_version }}
91+ PY_VER_CLEAN=${PY_VER//.}
92+ echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT
93+ - name : Run validatesRunnerBatchTests script
94+ uses : ./.github/actions/gradle-command-self-hosted-action
95+ with :
96+ gradle-command : :sdks:python:test-suites:dataflow:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:validatesRunnerBatchTests
97+ arguments : |
98+ -PuseWheelDistribution \
99+ -PpythonVersion=${{ matrix.python_version }} \
100+ - name : Run validatesRunnerStreamingTests script
101+ uses : ./.github/actions/gradle-command-self-hosted-action
102+ with :
103+ gradle-command : :sdks:python:test-suites:dataflow:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:validatesRunnerStreamingTests
104+ arguments : |
105+ -PuseWheelDistribution \
106+ -PpythonVersion=${{ matrix.python_version }} \
107+ - name : Archive code coverage results
108+ uses : actions/upload-artifact@v3
109+ with :
110+ name : python-code-coverage-report
111+ path : " **/pytest*.xml"
0 commit comments