Skip to content

Commit 8d103a2

Browse files
committed
Use secrets for credentials, fix CI
1 parent ebf62bc commit 8d103a2

File tree

4 files changed

+55
-48
lines changed

4 files changed

+55
-48
lines changed

.github/workflows/check.yml

+36-33
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,40 @@ jobs:
1515
check_document:
1616
name: Check packaging 📦
1717
runs-on: ubuntu-22.04
18+
env:
19+
AQT_TEST_EMAIL: ${{ secrets.TEST_EMAIL }}
20+
AQT_TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
1821
steps:
19-
- uses: actions/checkout@v4
20-
with:
21-
fetch-depth: 20
22-
fetch-tags: true
23-
- name: Set up Python 3.12
24-
uses: actions/setup-python@v5
25-
with:
26-
python-version: '3.12'
27-
- name: Install tools
28-
run: |
29-
pip install -U pip
30-
pip install tox tox-gh-actions coveralls coverage[toml]
31-
- name: Test
32-
run: |
33-
tox
34-
coverage xml -o cobertura.xml
35-
env:
36-
PYTEST_ADDOPTS: --cov-config=pyproject.toml --cov --cov-append --verbose
37-
- name: Upload Coverage
38-
run: coveralls --service=github
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
- uses: actions/setup-java@v4
42-
if: ( github.event_name == 'push' ) && ( github.ref == 'refs/heads/master' )
43-
with:
44-
distribution: 'temurin'
45-
java-version: '21'
46-
- name: Send coverage to codacy
47-
if: ( github.event_name == 'push' ) && ( github.ref == 'refs/heads/master' )
48-
run: |
49-
java -jar ci/codacy-coverage-reporter.jar report -l Python -t ${PROJECT_TOKEN} -r cobertura.xml
50-
env:
51-
PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 20
25+
fetch-tags: true
26+
- name: Set up Python 3.12
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.12'
30+
- name: Install tools
31+
run: |
32+
pip install -U pip
33+
pip install tox tox-gh-actions coveralls coverage[toml]
34+
- name: Test
35+
run: |
36+
tox
37+
coverage xml -o cobertura.xml
38+
env:
39+
PYTEST_ADDOPTS: --cov-config=pyproject.toml --cov --cov-append --verbose
40+
- name: Upload Coverage
41+
run: coveralls --service=github
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
- uses: actions/setup-java@v4
45+
if: ( github.event_name == 'push' ) && ( github.ref == 'refs/heads/master' )
46+
with:
47+
distribution: 'temurin'
48+
java-version: '21'
49+
- name: Send coverage to codacy
50+
if: ( github.event_name == 'push' ) && ( github.ref == 'refs/heads/master' )
51+
run: |
52+
java -jar ci/codacy-coverage-reporter.jar report -l Python -t ${PROJECT_TOKEN} -r cobertura.xml
53+
env:
54+
PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

aqt/settings.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,4 @@ patches :
253253
0193-Remove-the-unnecessary-template-parameter-from-the-c.patch
254254
0194-Fix-memory-leak-when-using-small-caps-font.patch
255255
0195-Make-sure-_q_printerChanged-is-called-even-if-only-p.patch
256-
0196-fix-Alt-shortcut-on-non-US-layouts.patch
256+
0196-fix-Alt-shortcut-on-non-US-layouts.patch

ci/generate_azure_pipelines_matrices.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ def __init__(self, platform, build_jobs):
300300
[
301301
BuildJob("install-qt", "6.1.3", "linux", "android", "android_armv7", "android_armv7", is_autodesktop=True),
302302
BuildJob("install-qt", "6.4.3", "linux", "android", "android_arm64_v8a", "android_arm64_v8a", is_autodesktop=True),
303-
BuildJob("install-qt-commercial", "6.8.1", "", "desktop", "linux_gcc_64", module="qtquick3d", is_autodesktop=False)
303+
BuildJob("install-qt-commercial", "6.8.1", "", "desktop", "linux_gcc_64",
304+
"linux_gcc_64", module="qtquick3d", is_autodesktop=False)
304305
]
305306
)
306307

@@ -310,7 +311,7 @@ def __init__(self, platform, build_jobs):
310311
[
311312
BuildJob("install-qt", "6.3.2", "windows", "android", "android_armv7", "android_armv7", is_autodesktop=True),
312313
BuildJob("install-qt", "6.4.3", "windows", "android", "android_x86_64", "android_x86_64", is_autodesktop=True),
313-
BuildJob("install-qt-commercial", "6.8.1", "", "desktop", "win64_msvc2022_64", module="qtquick3d", is_autodesktop=False)
314+
BuildJob("install-qt-commercial", "6.8.1", "", "desktop", "win64_msvc2022_64", "win64_msvc2022_64", is_autodesktop=False)
314315
]
315316
)
316317

tests/test_commercial.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def __init__(self, args, returncode):
3030
<package name="qt.qt6.680.addons.qtquick3d" displayname="Qt Quick 3D" version="6.8.0-0-202312011"/>
3131
</availablepackages>"""
3232

33+
TEST_EMAIL = os.getenv("AQT_TEST_EMAIL")
34+
TEST_PASSWORD = os.getenv("AQT_TEST_PASSWORD")
35+
3336

3437
class MockResponse:
3538
def __init__(self, status_code: int = 200, content: bytes = b"", text: str = "", headers: Dict = None):
@@ -62,8 +65,8 @@ def commercial_installer():
6265
target="desktop",
6366
arch="gcc_64",
6467
version="6.8.0",
65-
username="[email protected]",
66-
password="I_swear_this_is_not_a_Secr3t",
68+
username=TEST_EMAIL,
69+
password=TEST_PASSWORD,
6770
output_dir="./test_output",
6871
)
6972

@@ -103,14 +106,14 @@ def test_package_manager_init():
103106
arch="gcc_64",
104107
version=Version("6.8.0"),
105108
target="desktop",
106-
username="[email protected]",
107-
password="I_swear_this_is_not_a_Secr3t",
109+
username=TEST_EMAIL,
110+
password=TEST_PASSWORD,
108111
)
109112
assert manager.arch == "gcc_64"
110113
assert str(manager.version) == "6.8.0"
111114
assert manager.target == "desktop"
112-
assert manager.username == "[email protected]"
113-
assert manager.password == "I_swear_this_is_not_a_Secr3t"
115+
assert manager.username == TEST_EMAIL
116+
assert manager.password == TEST_PASSWORD
114117

115118

116119
@pytest.mark.parametrize(
@@ -286,8 +289,8 @@ def mock_safely_run(*args, **kwargs):
286289
abs_out = Path(details[0]).absolute()
287290

288291
# Get the email and password from the test parameters
289-
290-
password = "I_swear_this_is_not_a_Secr3t"
292+
email = TEST_EMAIL
293+
password = TEST_PASSWORD
291294

292295
formatted_cmd = cmd.format(arch, email, password)
293296
formatted_expected = expected_command.format(current_platform, abs_out, *details[1:], arch)
@@ -365,9 +368,9 @@ def modify_qt_config(content):
365368
[
366369
"list-qt-commercial",
367370
"--user",
368-
371+
TEST_EMAIL,
369372
"--password",
370-
"I_swear_this_is_not_a_Secr3t",
373+
TEST_PASSWORD,
371374
"6.8.1",
372375
],
373376
"search",
@@ -379,9 +382,9 @@ def modify_qt_config(content):
379382
"search",
380383
"6.8.0",
381384
"--email",
382-
385+
TEST_EMAIL,
383386
"--pw",
384-
"I_swear_this_is_not_a_Secr3t",
387+
TEST_PASSWORD,
385388
],
386389
"Downloading",
387390
),

0 commit comments

Comments
 (0)