-
Notifications
You must be signed in to change notification settings - Fork 17
227 lines (198 loc) · 8.21 KB
/
Copy pathverify-modules.yml
File metadata and controls
227 lines (198 loc) · 8.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Verify Modules
on:
push:
branches:
- main
- master
- refactor
pull_request:
branches:
- main
- master
- refactor
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BUILD_TYPE: Release
VCPKG_COMMIT: 14bb451131ccf6be50a63a8d9dfe7980e46b5958
jobs:
module-standalone:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
triplet: x64-linux
onnxruntime_ep: cpu
dml: OFF
- os: macos-14
triplet: arm64-osx
onnxruntime_ep: cpu
dml: OFF
- os: windows-latest
triplet: x64-windows
onnxruntime_ep: dml
dml: ON
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libxkbcommon-dev libxkbcommon-x11-0 ccache autoconf autoconf-archive automake libtool libltdl-dev \
libx11-dev libxft-dev libxext-dev libwayland-dev libegl1-mesa-dev libibus-1.0-dev libdbus-1-dev
- name: Setup ccache
if: runner.os != 'Windows'
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.triplet }}-modules
max-size: 500M
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.9.3'
cache: true
- name: Initialize MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Setup sccache (Windows)
if: runner.os == 'Windows'
uses: mozilla-actions/sccache-action@v0.0.7
- name: Configure sccache (Windows)
if: runner.os == 'Windows'
run: |
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $env:GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $env:GITHUB_ENV
- name: Configure Qt6 path (Unix)
if: runner.os != 'Windows'
run: |
echo "QT_DIR=$QT_ROOT_DIR" >> $GITHUB_ENV
echo "QT6_DIR=$QT_ROOT_DIR" >> $GITHUB_ENV
echo "GH_WORKSPACE=${{github.workspace}}" >> $GITHUB_ENV
- name: Configure Qt6 path (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
echo "QT_DIR=$QT_ROOT_DIR" | sed 's/\\/\//g' >> $GITHUB_ENV
echo "QT6_DIR=$QT_ROOT_DIR" | sed 's/\\/\//g' >> $GITHUB_ENV
echo "GH_WORKSPACE=${{github.workspace}}" | sed 's/\\/\//g' >> $GITHUB_ENV
- name: Cache vcpkg bootstrap
uses: actions/cache@v4
with:
path: |
${{github.workspace}}/vcpkg
!${{github.workspace}}/vcpkg/installed
key: vcpkg-bootstrap-${{ runner.os }}-${{ env.VCPKG_COMMIT }}
- name: Setup vcpkg
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 10
shell: bash
command: |
if [ -d "vcpkg/.git" ]; then
cd vcpkg && git fetch && git checkout ${{ env.VCPKG_COMMIT }} && cd ..
else
rm -rf vcpkg
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg && git checkout ${{ env.VCPKG_COMMIT }} && cd ..
fi
if [ "$RUNNER_OS" = "Windows" ]; then
vcpkg/bootstrap-vcpkg.bat -disableMetrics
else
vcpkg/bootstrap-vcpkg.sh -disableMetrics
fi
- name: Cache vcpkg installed packages
uses: actions/cache@v4
with:
path: ${{github.workspace}}/vcpkg/installed
key: vcpkg-installed-${{ matrix.triplet }}-${{ hashFiles('scripts/vcpkg-manifest/vcpkg.json') }}
restore-keys: |
vcpkg-installed-${{ matrix.triplet }}-
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Build Vcpkg packages (Unix)
if: runner.os != 'Windows'
working-directory: ${{github.workspace}}/vcpkg
run: |
./vcpkg install \
--x-manifest-root=../scripts/vcpkg-manifest \
--x-install-root=./installed \
--overlay-ports=../scripts/vcpkg/ports \
--overlay-triplets=../scripts/vcpkg/triplets \
--triplet=${{ matrix.triplet }}
env:
CMAKE_PREFIX_PATH: ${{env.QT_DIR}}
QT_DIR: ${{env.QT_DIR}}
Qt6_DIR: ${{env.QT_DIR}}
VCPKG_BUILD_TYPE: release
VCPKG_KEEP_ENV_VARS: 'CMAKE_PREFIX_PATH;QT_DIR;Qt6_DIR;VCPKG_BUILD_TYPE'
- name: Build Vcpkg packages (Windows)
if: runner.os == 'Windows'
shell: cmd
working-directory: ${{github.workspace}}/vcpkg
run: |
vcpkg.exe install --x-manifest-root=..\scripts\vcpkg-manifest --x-install-root=.\installed --overlay-ports=..\scripts\vcpkg\ports --overlay-triplets=..\scripts\vcpkg\triplets --triplet=${{ matrix.triplet }}
env:
CMAKE_PREFIX_PATH: ${{env.QT_DIR}}
QT_DIR: ${{env.QT_DIR}}
Qt6_DIR: ${{env.QT_DIR}}
VCPKG_BUILD_TYPE: release
VCPKG_KEEP_ENV_VARS: 'CMAKE_PREFIX_PATH;QT_DIR;Qt6_DIR;VCPKG_BUILD_TYPE'
- name: Install OnnxRuntime (Unix)
if: runner.os != 'Windows'
run: |
cmake -Dep=${{ matrix.onnxruntime_ep }} -P ${{github.workspace}}/cmake/setup-onnxruntime.cmake
- name: Install OnnxRuntime (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
cmake -Dep=${{ matrix.onnxruntime_ep }} -P "${{github.workspace}}/cmake/setup-onnxruntime.cmake"
- name: Configure CMake (Unix)
if: runner.os != 'Windows'
run: |
cmake -B ${{github.workspace}}/build -G Ninja \
-DBUILD_TESTS:BOOL=ON \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/deploy \
-DCMAKE_PREFIX_PATH=${{env.QT_DIR}}/lib/cmake/Qt6/ \
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DONNXRUNTIME_ENABLE_DML=${{ matrix.dml }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
cmake -B "${{github.workspace}}/build" -G Ninja -DBUILD_TESTS:BOOL=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/deploy" -DCMAKE_PREFIX_PATH="${{env.QT_DIR}}/lib/cmake/Qt6/" -DCMAKE_TOOLCHAIN_FILE="${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DONNXRUNTIME_ENABLE_DML=${{ matrix.dml }} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Verify framework modules build independently
run: |
echo "=== Verifying framework modules build independently ==="
cmake --build ${{github.workspace}}/build --target dsfw-base
cmake --build ${{github.workspace}}/build --target dsfw-core
cmake --build ${{github.workspace}}/build --target dsfw-ui-core
cmake --build ${{github.workspace}}/build --target dstools-domain
cmake --build ${{github.workspace}}/build --target slicer-lib
cmake --build ${{github.workspace}}/build --target minlabel-lib
cmake --build ${{github.workspace}}/build --target dstools-audio
cmake --build ${{github.workspace}}/build --target dsfw-widgets
echo "=== All framework modules built successfully ==="
- name: Build all targets
run: cmake --build ${{github.workspace}}/build --target all
- name: Install
run: cmake --build ${{github.workspace}}/build --target install
- name: Verify find_package(dsfw)
shell: bash
run: |
cmake -B tests/test-find-package/build -S tests/test-find-package -G Ninja \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_PREFIX_PATH="${GH_WORKSPACE}/deploy;${QT_DIR}/lib/cmake/Qt6/" \
-DCMAKE_TOOLCHAIN_FILE="${GH_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake"
cmake --build tests/test-find-package/build