Skip to content

Commit 3ab573a

Browse files
author
bram
committed
Fixed pipeliens
1 parent f4ddae9 commit 3ab573a

1 file changed

Lines changed: 38 additions & 30 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
pull_request:
1010
branches:
1111
- '**' # Runs the build for all pull requests
12+
workflow_dispatch: # Allow manual re-runs from the Actions tab
1213

1314
permissions:
1415
contents: write
@@ -19,6 +20,7 @@ jobs:
1920
build:
2021
runs-on: ${{ matrix.os }}
2122
strategy:
23+
fail-fast: false # Don't cancel other OS jobs when one fails
2224
matrix:
2325
os: [ubuntu-latest, macos-latest, windows-latest]
2426

@@ -359,9 +361,10 @@ jobs:
359361

360362
- name: Run tests (Linux)
361363
if: matrix.os == 'ubuntu-latest'
364+
shell: bash
362365
run: |
366+
set -o pipefail
363367
sudo apt-get install -y xvfb
364-
xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" cmake --build build --target all
365368
cd build
366369
mkdir -p Testing/Temporary
367370
chmod +x run_tests.sh
@@ -370,46 +373,51 @@ jobs:
370373
371374
- name: Run tests (macOS)
372375
if: matrix.os == 'macos-latest'
376+
shell: bash
373377
run: |
374-
cmake --build build --target all
378+
set -o pipefail
375379
cd build
376380
mkdir -p Testing/Temporary
377-
# Copy macOS-specific test script
378-
cp ../scripts/run_tests_mac.sh .
381+
# CMake already configures run_tests_mac.sh into build/ on APPLE;
382+
# copy again defensively in case the configure_file path changes.
383+
if [ ! -f run_tests_mac.sh ]; then
384+
cp ../scripts/run_tests_mac.sh .
385+
fi
379386
chmod +x run_tests_mac.sh
380387
echo "Running tests with filtered output..."
381388
./run_tests_mac.sh -v2 | tee Testing/Temporary/LastTest.log
382389
383390
- name: Run tests (Windows)
384391
if: matrix.os == 'windows-latest'
385-
shell: cmd
392+
shell: pwsh
386393
run: |
387-
cd build
388-
389-
echo "Directory contents of build:"
390-
dir
391-
392-
if not exist Testing\Temporary mkdir Testing\Temporary
393-
394-
echo "Running tests with filtered output..."
395-
396-
if exist run_tests.bat (
397-
echo "Found run_tests.bat, running tests..."
398-
run_tests.bat -v2
399-
rem Save output to a log file for artifacts
400-
run_tests.bat -v2 > Testing\Temporary\LastTest.log 2>&1
401-
) else if exist OpenCryptUITest.exe (
402-
echo "run_tests.bat not found, running executable directly..."
403-
set QT_LOGGING_RULES=*.debug=false
404-
set QT_MESSAGE_PATTERN=[%%{type}] %%{message}
405-
OpenCryptUITest.exe -v2
406-
rem Save output to a log file for artifacts
407-
OpenCryptUITest.exe -v2 > Testing\Temporary\LastTest.log 2>&1
408-
) else (
409-
echo "ERROR: Test executable not found!"
410-
dir
394+
Set-Location build
395+
396+
Write-Host "Directory contents of build:"
397+
Get-ChildItem
398+
399+
New-Item -ItemType Directory -Force -Path Testing\Temporary | Out-Null
400+
401+
Write-Host "Running tests with filtered output..."
402+
403+
$env:QT_LOGGING_RULES = "*.debug=false"
404+
$env:QT_MESSAGE_PATTERN = "[%{type}] %{message}"
405+
406+
if (Test-Path run_tests.bat) {
407+
Write-Host "Found run_tests.bat, running tests..."
408+
& cmd /c "run_tests.bat -v2" 2>&1 | Tee-Object -FilePath Testing\Temporary\LastTest.log
409+
$exit = $LASTEXITCODE
410+
} elseif (Test-Path OpenCryptUITest.exe) {
411+
Write-Host "run_tests.bat not found, running executable directly..."
412+
& .\OpenCryptUITest.exe -v2 2>&1 | Tee-Object -FilePath Testing\Temporary\LastTest.log
413+
$exit = $LASTEXITCODE
414+
} else {
415+
Write-Host "ERROR: Test executable not found!"
416+
Get-ChildItem
411417
exit 1
412-
)
418+
}
419+
420+
exit $exit
413421
414422
# Upload test results
415423
- name: Upload test results

0 commit comments

Comments
 (0)