Skip to content

Commit 78855ac

Browse files
committed
2022
1 parent ed9d190 commit 78855ac

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

.github/workflows/test-metatrader5-integration.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build:
77
strategy:
88
matrix:
9-
os: [windows-latest, windows-2022] # run on both Win runners
9+
os: [windows-latest, windows-2022]
1010
runs-on: ${{ matrix.os }}
1111
steps:
1212
- name: Checkout repository
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install MetaTrader5
2828
run: |
2929
$process = Start-Process -FilePath ".\mt5setup.exe" -ArgumentList "/auto", "/portable" -PassThru
30-
$process.WaitForExit(300000) # 5 minutes timeout
30+
$process.WaitForExit(300000)
3131
if (-not $process.HasExited) {
3232
Write-Host "MT5 installer stuck, killing..."
3333
Stop-Process -Id $process.Id -Force
@@ -66,17 +66,14 @@ jobs:
6666
run: pip install MetaTrader5
6767

6868
- name: Run Python inline script
69-
shell: pwsh
7069
run: |
71-
python -c "import MetaTrader5 as mt5; import time; print('Testing MT5 initialization...'); \
70+
python -c "import MetaTrader5 as mt5; import time; print('Testing MT5 initialization...'); import sys; \
7271
for attempt in range(12): \
7372
if mt5.initialize(): \
7473
print('MT5 initialized successfully'); \
7574
mt5.shutdown(); \
76-
break; \
75+
sys.exit(0); \
7776
else: \
7877
print(f'Attempt {attempt+1}: Not ready yet, sleeping...'); \
7978
time.sleep(5); \
80-
else: \
81-
print('Failed to initialize MT5 after waiting.'); \
82-
exit(1)"
79+
print('Failed to initialize MT5 after waiting.'); sys.exit(1)"

0 commit comments

Comments
 (0)