Skip to content

Commit 33cffeb

Browse files
committed
[feat] ci: update final bundle tests
1 parent fdea2dd commit 33cffeb

5 files changed

Lines changed: 81 additions & 9 deletions

File tree

.github/workflows/build_linux.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,21 @@ jobs:
6464
cd FastTrack
6565
chmod +x fasttrack.run
6666
./fasttrack.run -- --cli --help
67+
68+
- name: GUI startup smoke test
69+
run: |
70+
cd FastTrack
71+
chmod +x fasttrack.run
72+
73+
set +e
74+
timeout 10s ./fasttrack.run -- -platform offscreen
75+
status=$?
76+
set -e
77+
78+
if [ "$status" -eq 124 ]; then
79+
echo "GUI startup test passed: app stayed alive for 10 seconds."
80+
exit 0
81+
fi
82+
83+
echo "GUI startup test failed: app exited with status $status."
84+
exit "$status"

.github/workflows/build_mac.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
export PKG_CONFIG_PATH="$HOME/opencv-install/lib/pkgconfig:$PKG_CONFIG_PATH"
9090
export CMAKE_PREFIX_PATH="$HOME/opencv-install:$CMAKE_PREFIX_PATH"
9191
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
92+
export CMAKE_PREFIX_PATH="${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos:$CMAKE_PREFIX_PATH"
9293
./run.sh ci_clang
9394
- name: build_ft
9495
run: |
@@ -120,7 +121,7 @@ jobs:
120121
path: ./build/bin/FastTrack.dmg
121122

122123
test_bundle:
123-
runs-on: macos-latest
124+
runs-on: macos-26
124125
needs: build_mac
125126
steps:
126127
- name: download artifact
@@ -134,3 +135,23 @@ jobs:
134135
cd FastTrack
135136
hdiutil attach FastTrack.dmg -mountpoint /Volumes/FastTrackApp
136137
/Volumes/FastTrackApp/FastTrack.app/Contents/MacOS/FastTrack --cli --help
138+
139+
- name: GUI startup smoke test
140+
run: |
141+
brew install coreutils
142+
143+
cd FastTrack
144+
hdiutil attach FastTrack.dmg -mountpoint /Volumes/FastTrackApp
145+
146+
BIN=/Volumes/FastTrackApp/FastTrack.app/Contents/MacOS/FastTrack
147+
148+
gtimeout 20s "$BIN" -platform offscreen
149+
status=$?
150+
151+
if [ "$status" -eq 124 ]; then
152+
echo "GUI startup test passed: app stayed alive for 20 seconds."
153+
exit 0
154+
fi
155+
156+
echo "GUI startup test failed: app exited with status $status."
157+
exit "$status"

.github/workflows/build_win.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,22 @@ jobs:
6363
run: |
6464
cd FastTrack
6565
./FastTrack.exe --cli --help
66+
67+
- name: GUI startup smoke test
68+
shell: pwsh
69+
run: |
70+
cd FastTrack
71+
72+
$p = Start-Process -FilePath ".\FastTrack.exe" -PassThru -WindowStyle Hidden
73+
74+
Start-Sleep -Seconds 10
75+
76+
if ($p.HasExited) {
77+
Write-Host "GUI startup test failed: app exited early with code $($p.ExitCode)."
78+
exit $p.ExitCode
79+
}
80+
81+
Write-Host "GUI startup test passed: app stayed alive for 10 seconds."
82+
83+
Stop-Process -Id $p.Id -Force
84+
exit 0

.github/workflows/test.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,10 @@ jobs:
8181
test_mac:
8282
runs-on: macos-latest
8383
steps:
84-
- uses: actions/checkout@v2
85-
- uses: actions/setup-python@v2
84+
- uses: actions/setup-python@v5
8685
with:
87-
python-version: '3.8'
88-
- name: install_qt6
89-
run: |
90-
pip install aqtinstall
91-
python3 -m aqt install-qt -m qtcharts -O ${{ github.workspace }}/Qt/ mac desktop ${{ env.QT_VERSION }}
92-
echo ${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos/bin/ >> $GITHUB_PATH
86+
python-version: '3.11'
87+
- uses: actions/checkout@v2
9388
- name: Set up Homebrew #https://github.com/Homebrew/homebrew-cask/issues/150323
9489
id: set-up-homebrew
9590
uses: Homebrew/actions/setup-homebrew@master
@@ -101,6 +96,7 @@ jobs:
10196
rm -f /usr/local/bin/python3*
10297
rm -f /usr/local/opt/go/bin/go*
10398
rm -f /usr/local/bin/go*
99+
brew uninstall --ignore-dependencies qt@6 || true
104100
brew update -q -f
105101
brew upgrade -q -f
106102
brew install pkg-config
@@ -110,6 +106,12 @@ jobs:
110106
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
111107
python -m pip install --upgrade pip setuptools wheel
112108
python -m pip install numpy pandas pytest
109+
- name: install_qt6
110+
run: |
111+
python -m pip install aqtinstall
112+
python -m aqt install-qt -m qtcharts -O ${{ github.workspace }}/Qt/ mac desktop ${{ env.QT_VERSION }}
113+
echo ${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos/bin/ >> $GITHUB_PATH
113114
- name: test_ft
114115
run: |
116+
export CMAKE_PREFIX_PATH="${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos:$CMAKE_PREFIX_PATH"
115117
./test.sh unix

run.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,15 @@ if [ "$1" = "ci_clang" ]; then
5757
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DSKIP_TEST=ON ../
5858
make
5959
fi
60+
61+
if [ "$1" = "build_linux" ]; then
62+
act -W .github/workflows/build_linux.yml --rm --pull --artifact-server-path "$PWD/.artifacts"
63+
fi
64+
65+
if [ "$1" = "build_win" ]; then
66+
act -W .github/workflows/build_win.yml --rm --pull --artifact-server-path "$PWD/.artifacts"
67+
fi
68+
69+
if [ "$1" = "build_mac" ]; then
70+
act -W .github/workflows/build_mac.yml --rm --pull --artifact-server-path "$PWD/.artifacts"
71+
fi

0 commit comments

Comments
 (0)