Skip to content

Commit 7de704e

Browse files
claudevdmClaude
andauthored
Add dill test workflow (#36348)
* Add dill test workflow. * Disable other triggers temporarily. * Trigger on release to make checks pass. --------- Co-authored-by: Claude <cvandermerwe@google.com>
1 parent e4c891f commit 7de704e

1 file changed

Lines changed: 129 additions & 0 deletions

File tree

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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: PreCommit Python Dill tests with dill deps installed
17+
on:
18+
pull_request_target:
19+
branches: [ "master", "release-*" ]
20+
# paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_Python_Dill.json']
21+
paths: [ '.github/trigger_files/beam_PreCommit_Python_Dill.json', 'release/trigger_all_tests.json']
22+
issue_comment:
23+
types: [created]
24+
push:
25+
tags: ['v*']
26+
branches: ['master', 'release-*']
27+
# paths: [ "model/**","sdks/python/**","release/**",".github/workflows/beam_PreCommit_Python_Dill.yml"]
28+
paths: [ ".github/workflows/beam_PreCommit_Python_Dill.yml", 'release/trigger_all_tests.json']
29+
workflow_run:
30+
types: [created]
31+
schedule:
32+
- cron: '45 2/6 * * *'
33+
workflow_dispatch:
34+
35+
#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
36+
permissions:
37+
actions: write
38+
pull-requests: write
39+
checks: write
40+
contents: read
41+
deployments: read
42+
id-token: none
43+
issues: write
44+
discussions: read
45+
packages: read
46+
pages: read
47+
repository-projects: read
48+
security-events: read
49+
statuses: read
50+
51+
# This allows a subsequently queued workflow run to interrupt previous runs
52+
concurrency:
53+
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 }}'
54+
cancel-in-progress: true
55+
56+
env:
57+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
58+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
59+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
60+
61+
jobs:
62+
beam_PreCommit_Python_Dill:
63+
name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
64+
runs-on: ${{ matrix.os }}
65+
timeout-minutes: 180
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
job_name: ['beam_PreCommit_Python_Dill']
70+
job_phrase: ['Run Python_Dill PreCommit']
71+
python_version: ['3.12']
72+
# Run on both self-hosted and GitHub-hosted runners.
73+
# Some tests (marked require_docker_in_docker) can't run on Beam's
74+
# self-hosted runners due to Docker-in-Docker environment constraint.
75+
# These tests will only execute on ubuntu-latest (GitHub-hosted).
76+
# Context: https://github.com/apache/beam/pull/35585
77+
# Temporary removed the ubuntu-latest env till resolving deps issues.
78+
os: [[self-hosted, ubuntu-20.04, main]]
79+
if: |
80+
github.event_name == 'push' ||
81+
github.event_name == 'pull_request_target' ||
82+
(github.event_name == 'schedule' && github.repository == 'apache/beam') ||
83+
github.event_name == 'workflow_dispatch' ||
84+
startsWith(github.event.comment.body, 'Run Python_Dill PreCommit')
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Setup repository
88+
uses: ./.github/actions/setup-action
89+
with:
90+
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
91+
github_token: ${{ secrets.GITHUB_TOKEN }}
92+
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
93+
- name: Setup environment
94+
uses: ./.github/actions/setup-environment-action
95+
with:
96+
java-version: default
97+
python-version: ${{ matrix.python_version }}
98+
- name: Set PY_VER_CLEAN
99+
id: set_py_ver_clean
100+
run: |
101+
PY_VER=${{ matrix.python_version }}
102+
PY_VER_CLEAN=${PY_VER//.}
103+
echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT
104+
- name: Run pythonPreCommit
105+
uses: ./.github/actions/gradle-command-self-hosted-action
106+
with:
107+
gradle-command: :sdks:python:test-suites:tox:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:testPy${{steps.set_py_ver_clean.outputs.py_ver_clean}}Dill
108+
arguments: |
109+
-Pposargs="${{
110+
contains(matrix.os, 'self-hosted') &&
111+
'apache_beam/internal/ apache_beam/ml/ apache_beam/transforms/ apache_beam/typehints/ apache_beam/runners/portability/ -m (uses_dill and not require_docker_in_docker)' ||
112+
'apache_beam/internal/ apache_beam/ml/ apache_beam/transforms/ apache_beam/typehints/ apache_beam/runners/portability/ -m (uses_dill and require_docker_in_docker)'
113+
}}" \
114+
-PpythonVersion=${{ matrix.python_version }}
115+
- name: Archive Python Test Results
116+
uses: actions/upload-artifact@v4
117+
if: failure()
118+
with:
119+
name: Python ${{ matrix.python_version }} Test Results
120+
path: '**/pytest*.xml'
121+
- name: Publish Python Test Results
122+
uses: EnricoMi/publish-unit-test-result-action@v2
123+
if: always()
124+
with:
125+
commit: '${{ env.prsha || env.GITHUB_SHA }}'
126+
comment_mode: ${{ github.event_name == 'issue_comment' && 'always' || 'off' }}
127+
files: '**/pytest*.xml'
128+
large_files: true
129+

0 commit comments

Comments
 (0)