-
-
Notifications
You must be signed in to change notification settings - Fork 87
189 lines (187 loc) · 7.08 KB
/
test-install-qt.yml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Test on GH actions environment
on:
push:
branches:
- master
pull_request:
branches:
- master
- releases/*
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
py: ["3.12"]
qtver: [6.5.3, 6.6.3]
artifact: [standard]
include:
- os: windows-latest
py: "3.12"
qtver: 6.6.3
artifact: binary
- os: windows-latest
py: "3.12"
qtver: 6.7.3
artifact: standard
- os: ubuntu-latest
py: "3.12"
qtver: 6.8.0
artifact: standard
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 20
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Build and install
if: matrix.artifact == 'standard'
run: |
python -m pip install ./ --user
- name: Build Standalone binary(linux,mac)
if: matrix.artifact == 'binary' && matrix.os != 'windows-latest'
run: |
python -m venv venv
source venv/bin/activate
python -m pip install -U pip wheel setuptools setuptools_scm pyinstaller
python -m pip install .
python tools/build_standalone.py
deactivate
rm -rf venv
shell: bash
- name: Build Standalone binary(windows)
if: matrix.artifact == 'binary' && matrix.os == 'windows-latest'
run: |
python -m venv venv
venv/Scripts/activate.ps1
python -m pip install -U pip wheel setuptools setuptools_scm pyinstaller
python -m pip install .
python tools/build_standalone.py
deactivate
Remove-Item venv -Recurse -Force
shell: pwsh
- name: Run aqt
run: |
import os
import pathlib
import subprocess
timeout = 300
os.mkdir("Qt")
os.chdir("Qt")
artifact = "${{ matrix.artifact }}"
platform = "${{ matrix.os }}"
qtver = "${{ matrix.qtver }}"
env = os.environ.copy()
github_workspace = pathlib.Path(env["GITHUB_WORKSPACE"])
if artifact == "binary":
if platform.startswith("windows"):
bin_path = str(github_workspace / "dist" / "aqt.exe")
else:
bin_path = (github_workspace / "dist" / "aqt").as_posix()
prefix = [bin_path, "install-qt"]
else:
prefix = ["python", "-m", "aqt", "install-qt"]
command_line = []
command_line.extend(prefix)
if platform == "windows-latest":
if qtver.startswith('6.6'):
args = ["windows", "desktop", qtver, "win64_mingw"]
else:
args = ["windows", "desktop", qtver, "win64_msvc2019_64"]
elif platform == "macOS-latest":
args = ["mac", "desktop", qtver, "clang_64"]
elif qtver.startswith('6.8'):
args = ["linux", "desktop", qtver, "linux_gcc_64"]
else:
args = ["linux", "desktop", qtver, "gcc_64"]
command_line.extend(args)
command_line.extend(["--archives", "qtbase", "icu", "qt"])
env["AQT_CONFIG"] = (github_workspace / "ci" / "settings.ini").as_posix()
env["LOG_CFG"] = (github_workspace / "ci" / "logging.ini").as_posix()
print("Execute: {}".format(command_line))
try:
res = subprocess.run(command_line, timeout=timeout, check=True, env=env)
except subprocess.CalledProcessError as cpe:
exit(cpe.returncode)
assert res.returncode == 0
if qtver.startswith('6.6'):
command_line6 = []
command_line6.extend(prefix)
if platform.startswith("ubuntu"):
command_line6.extend(["linux", "android", qtver, "android_armv7"])
timeout = 360
elif platform.startswith("macOS"):
command_line6.extend(["mac", "ios", qtver, "ios"])
timeout = 360
else:
command_line6.extend(["windows", "android", qtver, "android_armv7"])
timeout = 360
print("Execute: {}".format(command_line6))
try:
res = subprocess.run(command_line6, timeout=timeout, check=True)
except subprocess.CalledProcessError as cpe:
exit(cpe.returncode)
assert res.returncode == 0
shell: python
working-directory: ${{ github.workspace }}
- name: Test qmake -query
run: |
import os
import pathlib
from subprocess import CalledProcessError, PIPE, run
os.chdir("Qt")
platform = "${{ matrix.os }}"
qtver = "${{ matrix.qtver }}"
if platform == "windows-latest":
if qtver.startswith('6.6'):
arch_dir = 'mingw_64'
else:
arch_dir = 'msvc2019_64'
elif platform == "macOS-latest":
arch_dir = 'clang_64'
else:
arch_dir = 'gcc_64'
try:
res = run([f"{qtver}/{arch_dir}/bin/qmake", "-query"], timeout=15, check=True, stdout=PIPE)
except CalledProcessError as cpe:
exit(cpe.returncode)
assert res.returncode == 0
print('Check prefix path qmake recognized...')
qt_prefix_path = pathlib.Path.cwd() / qtver / arch_dir
for line in res.stdout.splitlines():
if line.startswith(b'QT_INSTALL_PREFIX'):
result = line[18:].decode('UTF-8')
assert qt_prefix_path.samefile(result)
print('QT_INSTALL_PREFIX {}\nExpected path {}'.format(result, qt_prefix_path))
if qtver.startswith('6.6'):
print('Check prefix path by android/ios qmake recognized...')
if platform == "windows-latest":
target_dir = 'android_armv7'
qmake = os.path.join(qtver, 'android_armv7', 'bin', 'qmake.bat')
elif platform == "macOS-latest":
target_dir = 'ios'
qmake = os.path.join(qtver, 'ios', 'bin', 'qmake')
else:
target_dir = 'android_armv7'
qmake = os.path.join(qtver, 'android_armv7', 'bin', 'qmake')
try:
res = run([qmake, "-query"], timeout=15, check=True, stdout=PIPE)
except CalledProcessError as cpe:
exit(cpe.returncode)
assert res.returncode == 0
expected_path = pathlib.Path.cwd() / qtver / target_dir
for line in res.stdout.splitlines():
if line.startswith(b'QT_INSTALL_PREFIX'):
result = line[18:].decode('UTF-8')
print('QT_INATALL_PREFIX {}\nExpected path {}'.format(result, expected_path))
shell: python
working-directory: ${{ github.workspace }}
- uses: actions/upload-artifact@v4
if: matrix.artifact == 'binary'
with:
name: aqt-${{ matrix.os }}-standalone
path: dist\aqt*