11name : CI
22on :
33 pull_request :
4+ push :
5+ branches :
6+ - main
7+ - 3.*
48 workflow_call :
59 inputs :
610 build-number :
8993 strategy :
9094 fail-fast : false
9195 matrix :
92- target : ['macOS', 'iOS', 'tvOS', 'watchOS']
96+ platform : ['macOS', 'iOS', 'tvOS', 'watchOS']
9397
9498 steps :
9599@@ -104,29 +108,29 @@ jobs:
104108 # It's an edge case, but when a new alpha is released, we need to use it ASAP.
105109 check-latest : true
106110
107- - name : Build ${{ matrix.target }}
111+ - name : Build ${{ matrix.platform }}
108112 run : |
109- # Do the build for the requested target .
110- make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
113+ # Do the build for the requested platform .
114+ make ${{ matrix.platform }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
111115
112116 - name : Upload build artefacts
113117114118 with :
115- name : Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
116- path : dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
119+ name : Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
120+ path : dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
117121
118122 briefcase-testbed :
119- name : Briefcase testbed (${{ matrix.target }})
123+ name : Briefcase testbed (${{ matrix.platform }})
120124 runs-on : macOS-latest
121125 needs : [ config, build ]
122126 strategy :
123127 fail-fast : false
124128 matrix :
125- target : ["macOS", "iOS"]
129+ platform : ["macOS", "iOS"]
126130 include :
127131 - briefcase-run-args :
128132
129- - target : iOS
133+ - platform : iOS
130134 briefcase-run-args : ' -d "iPhone SE (3rd generation)"'
131135
132136 steps :
@@ -135,12 +139,12 @@ jobs:
135139 - name : Get build artifact
136140137141 with :
138- pattern : Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
142+ pattern : Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
139143 path : dist
140144 merge-multiple : true
141145
142146 - name : Set up Python
143- 147+ 144148 with :
145149 # Appending -dev ensures that we can always build the dev release.
146150 # It's a no-op for versions that have been published.
@@ -162,7 +166,117 @@ jobs:
162166 - name : Run support testbed check
163167 timeout-minutes : 10
164168 working-directory : Python-support-testbed
165- run : briefcase run ${{ matrix.target }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz\'
169+ run : briefcase run ${{ matrix.platform }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz\'
170+
171+ cpython-testbed :
172+ name : CPython testbed (${{ matrix.platform }})
173+ runs-on : macOS-latest
174+ needs : [ config, build ]
175+ strategy :
176+ fail-fast : false
177+ matrix :
178+ platform : ["iOS"]
179+
180+ steps :
181+ 182+
183+ - name : Get build artifact
184+ 185+ with :
186+ pattern : Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
187+ path : dist
188+ merge-multiple : true
189+
190+ - name : Set up Python
191+ 192+ with :
193+ # Appending -dev ensures that we can always build the dev release.
194+ # It's a no-op for versions that have been published.
195+ python-version : ${{ needs.config.outputs.PYTHON_VER }}-dev
196+ # Ensure that we *always* use the latest build, not a cached version.
197+ # It's an edge case, but when a new alpha is released, we need to use it ASAP.
198+ check-latest : true
199+
200+ - name : Unpack support package
201+ run : |
202+ mkdir -p support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
203+ cd support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
204+ tar zxvf ../../../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
205+
206+ - name : Run CPython testbed
207+ timeout-minutes : 10
208+ working-directory : support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
209+ run : |
210+ # Run a representative subset of CPython core tests:
211+ # - test_builtin as a test of core language tools
212+ # - test_grammar as a test of core language features
213+ # - test_os as a test of system library calls
214+ # - test_bz2 as a simple test of third party libraries
215+ # - test_ctypes as a test of FFI
216+ python -m testbed run -- test --single-process --rerun -W test_builtin test_grammar test_os test_bz2 test_ctypes
217+
218+ crossenv-test :
219+ name : Cross-platform env test (${{ matrix.platform }})
220+ runs-on : macOS-latest
221+ needs : [ config, build ]
222+ strategy :
223+ fail-fast : false
224+ matrix :
225+ include :
226+ - platform : iOS
227+ slice : ios-arm64_x86_64-simulator
228+ multiarch : arm64-iphonesimulator
229+ - platform : iOS
230+ slice : ios-arm64_x86_64-simulator
231+ multiarch : x86_64-iphonesimulator
232+ - platform : iOS
233+ slice : ios-arm64
234+ multiarch : arm64-iphoneos
235+
236+ steps :
237+ 238+
239+ - name : Get build artifact
240+ 241+ with :
242+ pattern : Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
243+ path : dist
244+ merge-multiple : true
245+
246+ - name : Set up Python
247+ 248+ with :
249+ # Appending -dev ensures that we can always build the dev release.
250+ # It's a no-op for versions that have been published.
251+ python-version : ${{ needs.config.outputs.PYTHON_VER }}-dev
252+ # Ensure that we *always* use the latest build, not a cached version.
253+ # It's an edge case, but when a new alpha is released, we need to use it ASAP.
254+ check-latest : true
255+
256+ - name : Unpack support package
257+ run : |
258+ mkdir -p support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
259+ cd support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
260+ tar zxvf ../../../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
261+
262+ - name : Run cross-platform environment test
263+ env :
264+ PYTHON_CROSS_PLATFORM : ${{ matrix.platform }}
265+ PYTHON_CROSS_SLICE : ${{ matrix.slice }}
266+ PYTHON_CROSS_MULTIARCH : ${{ matrix.multiarch }}
267+ run : |
268+ # Create and activate a native virtual environment
269+ python${{ needs.config.outputs.PYTHON_VER }} -m venv cross-venv
270+ source cross-venv/bin/activate
271+
272+ # Install pytest
273+ python -m pip install pytest
274+
275+ # Convert venv into cross-venv
276+ python support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}/Python.xcframework/${{ matrix.slice }}/platform-config/${{ matrix.multiarch }}/make_cross_venv.py cross-venv
277+
278+ # Run the test suite
279+ python -m pytest tests
166280
167281 cpython-testbed :
168282 name : CPython testbed (${{ matrix.target }})
0 commit comments