Skip to content

Commit 494f7b7

Browse files
committed
Correct issues with testing in CI (#295)
Adds a patch to account for empty testing simulator sets. Also adds CI to confirm the testbed works in a CI environment.
1 parent 979bfaa commit 494f7b7

File tree

2 files changed

+24763
-153
lines changed

2 files changed

+24763
-153
lines changed

.github/workflows/ci.yaml

Lines changed: 81 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,6 @@ jobs:
9090
fail-fast: false
9191
matrix:
9292
target: ['macOS', 'iOS', 'tvOS', 'watchOS']
93-
include:
94-
- briefcase-run-args:
95-
- run-tests: false
96-
97-
- target: macOS
98-
run-tests: true
99-
100-
- target: iOS
101-
briefcase-run-args: ' -d "iPhone SE (3rd generation)"'
102-
run-tests: true
10393

10494
steps:
10595
- uses: actions/[email protected]
@@ -125,20 +115,98 @@ jobs:
125115
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
126116
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
127117

118+
briefcase-testbed:
119+
name: Briefcase testbed (${{ matrix.target }})
120+
runs-on: macOS-latest
121+
needs: [ config, build ]
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
target: ["macOS", "iOS"]
126+
include:
127+
- briefcase-run-args:
128+
129+
- target: iOS
130+
briefcase-run-args: ' -d "iPhone SE (3rd generation)"'
131+
132+
steps:
133+
- uses: actions/[email protected]
134+
135+
- name: Get build artifact
136+
uses: actions/[email protected]
137+
with:
138+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
139+
path: dist
140+
merge-multiple: true
141+
142+
- name: Set up Python
143+
uses: actions/[email protected]
144+
with:
145+
# Appending -dev ensures that we can always build the dev release.
146+
# It's a no-op for versions that have been published.
147+
python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev
148+
# Ensure that we *always* use the latest build, not a cached version.
149+
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
150+
check-latest: true
151+
128152
- uses: actions/[email protected]
129-
if: matrix.run-tests
130153
with:
131154
repository: beeware/Python-support-testbed
132155
path: Python-support-testbed
133156

134157
- name: Install dependencies
135-
if: matrix.run-tests
136158
run: |
137159
# Use the development version of Briefcase
138160
python -m pip install git+https://github.com/beeware/briefcase.git
139161
140162
- name: Run support testbed check
141-
if: matrix.run-tests
142163
timeout-minutes: 10
143164
working-directory: Python-support-testbed
144165
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\'
166+
167+
cpython-testbed:
168+
name: CPython testbed (${{ matrix.target }})
169+
runs-on: macOS-latest
170+
needs: [ config, build ]
171+
strategy:
172+
fail-fast: false
173+
matrix:
174+
target: ["iOS"]
175+
176+
steps:
177+
- uses: actions/[email protected]
178+
179+
- name: Get build artifact
180+
uses: actions/[email protected]
181+
with:
182+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
183+
path: dist
184+
merge-multiple: true
185+
186+
- name: Set up Python
187+
uses: actions/[email protected]
188+
with:
189+
# Appending -dev ensures that we can always build the dev release.
190+
# It's a no-op for versions that have been published.
191+
python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev
192+
# Ensure that we *always* use the latest build, not a cached version.
193+
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
194+
check-latest: true
195+
196+
- name: Unpack support package
197+
run: |
198+
mkdir support
199+
cd support
200+
tar zxvf ../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
201+
202+
- name: Run CPython testbed
203+
timeout-minutes: 10
204+
working-directory: support
205+
run: |
206+
# Run a representative subset of CPython core tests:
207+
# - test_builtin as a test of core language tools
208+
# - test_grammar as a test of core language features
209+
# - test_os as a test of system library calls
210+
# - test_bz2 as a simple test of third party libraries
211+
# - test_ctypes as a test of FFI
212+
python -m testbed run -- test --single-process --rerun -W test_builtin test_grammar test_os test_bz2 test_ctypes

0 commit comments

Comments
 (0)