-
Notifications
You must be signed in to change notification settings - Fork 5
344 lines (295 loc) · 11.2 KB
/
Copy pathtest.yml
File metadata and controls
344 lines (295 loc) · 11.2 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
name: test
on:
push:
branches:
- "**"
paths:
- ".github/workflows/test-rust.yml"
- "**/src/**"
- "**/tests/**"
- "**/Cargo.toml"
- "**/build.rs"
- "**/examples/**"
pull_request:
branches:
- "**"
paths:
- ".github/workflows/test-rust.yml"
- "src/**"
- "Cargo.toml"
- "build.rs"
- "tests/**"
- "examples/**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.head_ref || github.ref_name }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
cancel-in-progress: true
jobs:
windows:
runs-on: windows-latest
strategy:
matrix:
arch: [x86_64]
fail-fast: false
steps:
- name: Windows runner hack
shell: cmd
run: |
dir d:\a
cd ..
mkdir C:\MaaFramework
rmdir MaaFramework
mklink /j MaaFramework C:\MaaFramework
dism /Online /Disable-Feature /FeatureName:Windows-Defender /Remove /NoRestart /Quiet
cd .
- name: Windows runner hack (2)
uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "D:"
- name: Checkout self
uses: actions/checkout@v4
with:
path: maa-framework-rs
- name: Checkout MaaFramework
uses: actions/checkout@v4
with:
repository: MaaXYZ/MaaFramework
submodules: recursive
path: MaaFramework
- name: Setup Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2.2
with:
sdk-version: 26100
- name: Setup Python
uses: actions/setup-python@v5.2.0
with:
python-version: "3.9"
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-msvc
- name: Install LLVM
run: choco install llvm -y
- name: Bootstrap MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd MaaFramework
python tools/maadeps-download.py ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-windows
- name: Build MAA
run: |
cd MaaFramework
cmake --preset "${{ matrix.arch == 'x86_64' && 'MSVC 2022' || 'MSVC 2022 ARM' }}" -DMAADEPS_TRIPLET="maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-windows" -DCMAKE_SYSTEM_VERSION="10.0.26100.0" -DMAA_HASH_VERSION="CI-Build" -DWITH_NODEJS_BINDING=OFF -DWITH_QUICKJS_BINDING=OFF -DBUILD_PICLI=OFF -DWITH_DBG_CONTROLLER=ON -DBUILD_PIPELINE_TESTING=ON -DBUILD_DLOPEN_TESTING=ON
cmake --build build --preset "${{ matrix.arch == 'x86_64' && 'MSVC 2022' || 'MSVC 2022 ARM' }} - Debug" -j 16
- name: Install MAA
shell: bash
run: |
cd MaaFramework
cmake --install build --prefix ../install --config Debug
- name: Download Plugin
uses: robinraju/release-downloader@v1
with:
repository: MaaXYZ/MaaPluginDemo
latest: true
fileName: "*win-${{ matrix.arch }}*"
out-file-path: "download_plugins"
extract: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Plugin
shell: bash
run: |
mkdir -p install/bin/plugins
cp -r download_plugins/bin/. install/bin/plugins/
- name: Run Rust testing
shell: bash
run: |
# Move out of maa-framework-rs because we checked it out via path: maa-framework-rs
# Actually, to run cargo test, we need to be IN maa-framework-rs
# But earlier I said "Checkout self path: maa-framework-rs".
# The structure is:
# D:\a\maa-framework-rs\maa-framework-rs (repo content)
# D:\a\maa-framework-rs\MaaFramework (core content)
# D:\a\maa-framework-rs\install (installed libs)
# D:\a\maa-framework-rs\download_plugins
# Setup paths for tests
export MAA_SDK_PATH=$(pwd)/install
export MAA_TEST_RESOURCES_DIR=$(pwd)/MaaFramework/test/TestingDataSet/PipelineSmoking
# Debug: show structure
ls -R install || true
cd maa-framework-rs
cargo test --verbose -- --test-threads=1
cargo test --verbose --features dynamic -- --test-threads=1
ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64]
fail-fast: false
steps:
- name: Install dep
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build cmake ccache libclang-dev libpipewire-0.3-dev libdbus-1-dev meson python3-jinja2
# Ubuntu 24.04 ships libei 1.2.1, but MaaFramework requires 1.6.0.
- name: Build libei 1.6.0 (host)
run: |
curl -fsSL -o /tmp/libei.tar.gz https://gitlab.freedesktop.org/libinput/libei/-/archive/1.6.0/libei-1.6.0.tar.gz
tar xzf /tmp/libei.tar.gz -C /tmp
sed -i "/subdir('tools')/d" /tmp/libei-1.6.0/meson.build
meson setup /tmp/libei-1.6.0/build /tmp/libei-1.6.0 \
-Dprefix=/usr -Dtests=disabled -Dliboeffis=disabled -Dlibeis=disabled -Ddocumentation= -Dbuildtype=release
sudo meson install -C /tmp/libei-1.6.0/build
- name: Checkout self
uses: actions/checkout@v4
with:
path: maa-framework-rs
- name: Checkout MaaFramework
uses: actions/checkout@v4
with:
repository: MaaXYZ/MaaFramework
submodules: recursive
path: MaaFramework
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
remove_stale_cache: false
- name: Setup Python
uses: actions/setup-python@v5.2.0
with:
python-version: "3.9"
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Bootstrap MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd MaaFramework
python3 tools/maadeps-download.py ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux
- name: Build MAA
run: |
cd MaaFramework
cmake --preset 'NinjaMulti Linux ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}' \
-DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux' \
-DMAA_HASH_VERSION="CI-Build" \
-DWITH_NODEJS_BINDING=OFF -DWITH_QUICKJS_BINDING=OFF \
-DBUILD_PICLI=OFF \
-DWITH_DBG_CONTROLLER=ON -DBUILD_PIPELINE_TESTING=ON \
-DBUILD_DLOPEN_TESTING=ON
cmake --build build --preset 'NinjaMulti Linux ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }} - Debug' -j 16
- name: Install MAA
shell: bash
run: |
cd MaaFramework
cmake --install build --prefix ../install --config Debug
- name: Download Plugin
uses: robinraju/release-downloader@v1
with:
repository: MaaXYZ/MaaPluginDemo
latest: true
fileName: "*linux-${{ matrix.arch }}*"
out-file-path: "download_plugins"
extract: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Plugin
shell: bash
run: |
mkdir -p install/bin/plugins
cp -r download_plugins/bin/. install/bin/plugins/
- name: Run Rust testing
shell: bash
run: |
export MAA_SDK_PATH=$(pwd)/install
export MAA_TEST_RESOURCES_DIR=$(pwd)/MaaFramework/test/TestingDataSet/PipelineSmoking
cd maa-framework-rs
cargo test --verbose -- --test-threads=1
cargo test --verbose --features dynamic -- --test-threads=1
macos:
runs-on: macos-15
strategy:
matrix:
arch: [aarch64]
fail-fast: false
steps:
- name: Checkout self
uses: actions/checkout@v4
with:
path: maa-framework-rs
- name: Checkout MaaFramework
uses: actions/checkout@v4
with:
repository: MaaXYZ/MaaFramework
submodules: recursive
path: MaaFramework
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.2
- name: Install dep
run: |
brew install ninja ccache llvm
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
remove_stale_cache: false
- name: Setup Python
uses: actions/setup-python@v5.2.0
with:
python-version: "3.9"
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: aarch64-apple-darwin
- name: Bootstrap MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd MaaFramework
python3 tools/maadeps-download.py ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx
- name: Build MAA
run: |
cd MaaFramework
cmake --preset 'NinjaMulti' \
-DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx' \
-DMAA_HASH_VERSION="CI-Build" \
-DCMAKE_OSX_SYSROOT=macosx \
-DWITH_NODEJS_BINDING=OFF -DWITH_QUICKJS_BINDING=OFF \
-DBUILD_PICLI=OFF \
-DWITH_DBG_CONTROLLER=ON -DBUILD_PIPELINE_TESTING=ON \
-DBUILD_DLOPEN_TESTING=ON \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.arch == 'x86_64' && 'x86_64' || 'arm64' }}'
cmake --build build --preset 'NinjaMulti - Debug' -j 16
- name: Install MAA
shell: bash
run: |
cd MaaFramework
cmake --install build --prefix ../install --config Debug
- name: Download Plugin
uses: robinraju/release-downloader@v1
with:
repository: MaaXYZ/MaaPluginDemo
latest: true
fileName: "*macos-${{ matrix.arch }}*"
out-file-path: "download_plugins"
extract: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Plugin
shell: bash
run: |
mkdir -p install/bin/plugins
cp -r download_plugins/bin/. install/bin/plugins/
- name: Run Rust testing
shell: bash
run: |
export MAA_SDK_PATH=$(pwd)/install
export MAA_TEST_RESOURCES_DIR=$(pwd)/MaaFramework/test/TestingDataSet/PipelineSmoking
export DYLD_LIBRARY_PATH=$(pwd)/install/bin:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(pwd)/install/bin:$LD_LIBRARY_PATH
cd maa-framework-rs
cargo test --verbose -- --test-threads=1
cargo test --verbose --features dynamic -- --test-threads=1