Skip to content

Commit 7d2092a

Browse files
committed
Fix CI
1 parent fd89995 commit 7d2092a

7 files changed

Lines changed: 89 additions & 87 deletions

File tree

.github/workflows/test_and_build.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -13,61 +13,61 @@ permissions:
1313

1414

1515
jobs:
16-
#test_minimal:
17-
# runs-on: windows-latest
18-
# strategy:
19-
# fail-fast: false
20-
# steps:
21-
# - uses: actions/checkout@v4
22-
# with:
23-
# persist-credentials: false
24-
# - name: Set up Python 3.13.2
25-
# uses: actions/setup-python@v5
26-
# with:
27-
# python-version: "3.13.2"
28-
# - name: Install poetry
29-
# run: |
30-
# pip install -U pip
31-
# pip install poetry
32-
# - name: Install dependencies
33-
# run: poetry install
34-
# - name: Set screen resolution
35-
# run: |
36-
# Set-DisplayResolution -Width 1920 -Height 1080 -Force
37-
# sleep 10
38-
# - name: Run tests
39-
# id: tests
40-
# run: poetry run coverage run -m pytest tests
41-
# continue-on-error: true
42-
# - name: Upload screenshot test artifacts for debugging purposes
43-
# if: steps.tests.outcome != 'success'
44-
# uses: actions/upload-artifact@v4
45-
# with:
46-
# name: screenshots
47-
# path: tests/captured
48-
# retention-days: 1
49-
# - name: Exit if tests failed
50-
# if: steps.tests.outcome != 'success'
51-
# run: exit 1
52-
# - name: Install types
53-
# run: poetry add types-PyYAML types-requests
54-
# - name: Check MyPy
55-
# run: poetry run mypy embark
56-
# - name: Check Ruff
57-
# run: poetry run ruff check
58-
# - name: Check WPS
59-
# run: poetry run flake8 embark tests
60-
# - name: Check imports
61-
# run: poetry run lint-imports
62-
# - name: Upload coverage reports to Codecov
63-
# uses: codecov/codecov-action@v5
64-
# with:
65-
# token: ${{ secrets.CODECOV_TOKEN }}
66-
# slug: Tapeline/Embark
16+
test_minimal:
17+
runs-on: windows-latest
18+
strategy:
19+
fail-fast: false
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
24+
- name: Set up Python 3.13.2
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.13.2"
28+
- name: Install poetry
29+
run: |
30+
pip install -U pip
31+
pip install poetry
32+
- name: Install dependencies
33+
run: poetry install
34+
- name: Set screen resolution
35+
run: |
36+
Set-DisplayResolution -Width 1920 -Height 1080 -Force
37+
sleep 10
38+
- name: Run tests
39+
id: tests
40+
run: poetry run coverage run -m pytest tests
41+
continue-on-error: true
42+
- name: Upload screenshot test artifacts for debugging purposes
43+
if: steps.tests.outcome != 'success'
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: screenshots
47+
path: tests/captured
48+
retention-days: 1
49+
- name: Exit if tests failed
50+
if: steps.tests.outcome != 'success'
51+
run: exit 1
52+
- name: Install types
53+
run: poetry add types-PyYAML types-requests
54+
- name: Check MyPy
55+
run: poetry run mypy embark
56+
- name: Check Ruff
57+
run: poetry run ruff check
58+
- name: Check WPS
59+
run: poetry run flake8 embark tests
60+
- name: Check imports
61+
run: poetry run lint-imports
62+
- name: Upload coverage reports to Codecov
63+
uses: codecov/codecov-action@v5
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}
66+
slug: Tapeline/Embark
6767

6868
build:
69-
#needs:
70-
# - test_minimal
69+
needs:
70+
- test_minimal
7171
runs-on: windows-latest
7272
strategy:
7373
fail-fast: false

embark/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ def main() -> None:
9191
ui_main.main()
9292
else:
9393
args = _configure_arg_parser().parse_args()
94-
args.func(args)
94+
ret_code = args.func(args)
95+
if ret_code is not None:
96+
sys.exit(ret_code)
97+
sys.exit(0)
9598

9699

97100
if __name__ == "__main__":

embark/platform_impl/windows/install_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def get_installation_from_registry(
7373
software_uninstall, software_quiet_uninstall
7474
)
7575
return WindowsInstallation(
76-
name=software_name,
76+
name=software_name or reg_path,
7777
version=software_version or "",
7878
major_version=software_major_version,
7979
minor_version=software_minor_version,

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
line-length = 79
22

3-
extend-exclude = ["stubs"]
3+
extend-exclude = ["stubs", "tests/package"]
44

55
[lint]
66

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ allowed-domain-names =
1414

1515
extend-exclude =
1616
stubs
17+
tests/package
1718

1819

1920
extend-ignore =

tests/package/assert_installed.ps1

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,50 @@ echo "Checking for installed programs"
33
$ErrorActionPreference = "Stop"
44

55
echo "Checking Kumir"
6-
./embark.exe dqi "Кумир 2.1.0-rc11" --ignore-version
6+
./embark.exe dqi "(Кумир|.{5}) 2.1.0-rc11" --ignore-version
7+
if (0 -ne $LastExitCode) {
8+
echo "No Kumir found"
9+
exit 1
10+
}
711

812
echo "Checking PascalABC.NET"
913
./embark.exe dqi "PascalABC.NET" --publisher "" --ignore-version
14+
if (0 -ne $LastExitCode) {
15+
echo "No PascalABC.NET found"
16+
exit 1
17+
}
1018

1119
echo "Checking LibreOffice"
1220
./embark.exe dqi "LibreOffice [0-9\\.]*" --publisher "The Document Foundation" --version "403177474"
21+
if (0 -ne $LastExitCode) {
22+
echo "No LibreOffice found"
23+
exit 1
24+
}
1325

1426
echo "Checking CodeBlocks"
1527
./embark.exe dqi "CodeBlocks" --publisher "The Code::Blocks Team" --version "20.03"
28+
if (0 -ne $LastExitCode) {
29+
echo "No CodeBlocks found"
30+
exit 1
31+
}
1632

1733
echo "Checking Chrome"
1834
./embark.exe dqi "Google Chrome" --publisher "Google LLC" --ignore-version
19-
20-
# echo "Checking JDK"
21-
# ./embark.exe dqi "Java .* 23 (64-bit)" --publisher "Oracle Corporation" --version "23.0.0.0"
35+
if (0 -ne $LastExitCode) {
36+
echo "No Chrome found"
37+
exit 1
38+
}
2239

2340
echo "Checking PyCharm"
2441
./embark.exe dqi "PyCharm .*" --publisher "JetBrains s.r.o." --ignore-version
42+
if (0 -ne $LastExitCode) {
43+
echo "No PyCharm found"
44+
exit 1
45+
}
2546

2647
echo "Checking IntelliJ"
2748
./embark.exe dqi "IntelliJ IDEA .*" --publisher "JetBrains s.r.o." --ignore-version
49+
if (0 -ne $LastExitCode) {
50+
echo "No IntelliJ found"
51+
exit 1
52+
}

tests/package/playbook.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
name: Пакет КЕГЭ/ОГЭ по информатике
2-
variables:
3-
SELECTED_USER_DIR: "%UserProfile%"
42
tasks:
53
# We operate in console mode
64
# - name: Select user
@@ -84,28 +82,3 @@ tasks:
8482
version: ""
8583
ignore_version: true
8684
installer: assets/ideaIC-2024.2.3.exe
87-
88-
- name: Copy IDLE Shortcut # Example of how files are copied
89-
std.copy:
90-
src: "C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Python 3.13/IDLE (Python 3.13 64-bit).lnk"
91-
dst: "{{SELECTED_USER_DIR}}\\Desktop\\IDLE.lnk" # Don't forget to escape backslashes!
92-
- name: Copy CodeBlocks Shortcut
93-
std.copy:
94-
src: "C:/ProgramData/Microsoft/Windows/Start Menu/Programs/CodeBlocks/CodeBlocks.lnk"
95-
dst: "{{SELECTED_USER_DIR}}\\Desktop\\CodeBlocks.lnk"
96-
- name: Copy IntelliJ Shortcut
97-
std.copy:
98-
src: "C:/ProgramData/Microsoft/Windows/Start Menu/Programs/JetBrains/IntelliJ IDEA Community Edition 2024.2.3.lnk"
99-
dst: "{{SELECTED_USER_DIR}}\\Desktop\\IntelliJ IDEA.lnk"
100-
- name: Copy PyCharm Shortcut
101-
std.copy:
102-
src: "C:/ProgramData/Microsoft/Windows/Start Menu/Programs/JetBrains/PyCharm Community Edition 2024.2.3.lnk"
103-
dst: "{{SELECTED_USER_DIR}}\\Desktop\\PyCharm.lnk"
104-
- name: Copy Kumir Shortcut
105-
std.copy:
106-
src: "C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Кумир 2.1.0-rc11/Кумир-Стандарт.lnk"
107-
dst: "{{SELECTED_USER_DIR}}\\Desktop\\Кумир-Стандарт.lnk"
108-
- name: Copy PascalABC Shortcut
109-
std.copy:
110-
src: "%AppData%/Microsoft/Windows/Start Menu/Programs/PascalABC.NET/PascalABC.NET.lnk"
111-
dst: "{{SELECTED_USER_DIR}}\\Desktop\\PascalABC.NET.lnk"

0 commit comments

Comments
 (0)