-
-
Notifications
You must be signed in to change notification settings - Fork 635
92 lines (81 loc) · 2.94 KB
/
Copy pathios-build.yml
File metadata and controls
92 lines (81 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: iOS Build
on:
workflow_dispatch:
inputs:
build_python_runtime:
description: 'Build Python.xcframework before the iOS host'
required: false
default: false
type: boolean
pull_request:
paths:
- 'interop/ios/**'
- 'webview/**'
- 'tests/**'
- '.github/workflows/ios-build.yml'
- 'pyproject.toml'
jobs:
simulator:
name: iOS simulator validation
runs-on: macos-latest
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[cli,dev]"
- name: Check Xcode toolchain
run: |
xcodebuild -version
xcode-select -p
- name: Run platform-independent tests
run: >-
pytest -q
tests/test_util.py
tests/test_ios_backend.py
- name: Scaffold test app
run: pywebview2 init testapp --name "CLI Smoke Test" --identifier com.example.clismoketest --yes
- name: Build Python iOS support
if: ${{ inputs.build_python_runtime == true }}
run: |
git clone --depth 1 --branch 3.13 https://github.com/beeware/Python-Apple-support.git .build/python-apple-support
make -C .build/python-apple-support iOS
archive=$(find .build/python-apple-support/dist -type f -name '*.tar.gz' -print -quit)
if [ -z "$archive" ]; then
echo 'Python-Apple-support did not produce an archive'
find .build/python-apple-support/dist -maxdepth 2 -type f 2>/dev/null || true
exit 1
fi
mkdir -p .build/python-runtime
tar -xzf "$archive" -C .build/python-runtime
runtime=$(find "$GITHUB_WORKSPACE/.build/python-runtime" -type d -name Python.xcframework -print -quit)
if [ -z "$runtime" ]; then
echo 'Python.xcframework was not produced by Python-Apple-support'
find .build/python-apple-support -maxdepth 4 -type f | head -100
exit 1
fi
echo "PYWEBVIEW_IOS_PYTHON_XCFRAMEWORK=$runtime" >> "$GITHUB_ENV"
- name: Build native iOS host for simulator
working-directory: testapp
run: |
python - <<'PY'
import json
path = 'pywebview2.conf.json'
with open(path) as f:
config = json.load(f)
config['bundle']['targets'] = ['ios']
with open(path, 'w') as f:
json.dump(config, f, indent=2)
PY
pywebview2 build --target ios --dist .build
- name: Upload simulator app
uses: actions/upload-artifact@v4
with:
name: pywebview-ios-simulator
path: testapp/.build/ios/.derived-data/Build/Products/Debug-iphonesimulator/CLI Smoke Test.app