-
Notifications
You must be signed in to change notification settings - Fork 2
302 lines (297 loc) · 9.39 KB
/
CI.yml
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
name: CI
on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/docker.yml'
- '.github/workflows/github-pages.yaml'
- 'doc/**'
- Dockerfile
- docker-compose.yml
- README.md
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Build
run: cargo build -vv
- name: Run tests
run: cargo test --verbose
build-exif:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Get cache key
id: cache_key
run: |
cd scripts
python3 get_cache_key.py exiv2 || exit 1
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: clib/
key: ${{ runner.os }}-${{ steps.cache_key.outputs.cache_key }}
- name: Build thirdparty library
if: steps.cache.outputs.cache-hit != 'true'
run: |
cp scripts/build_*.sh -v ./ || exit 1
./build_exiv2.sh || exit 1
- name: Build
run: |
export CMAKE_PREFIX_PATH=`pwd`/clib
cargo build --features exif -vv || exit 1
- name: Test
run: |
export CMAKE_PREFIX_PATH=`pwd`/clib
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
cargo test --features exif --verbose -- --show-output || exit 1
build-ugoira:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Get cache key
id: cache_key
run: |
cd scripts
python3 get_cache_key.py libzip x264 ffmpeg || exit 1
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: clib/
key: ${{ runner.os }}-${{ steps.cache_key.outputs.cache_key }}
- name: Setup NASM
if: steps.cache.outputs.cache-hit != 'true'
uses: ilammy/setup-nasm@v1
- name: Build thirdparty library
if: steps.cache.outputs.cache-hit != 'true'
run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
cp scripts/build_*.sh -v ./ || exit 1
./build_libzip.sh || exit 1
./build_x264.sh || exit 1
./build_ffmpeg.sh || exit 1
- name: Build
run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
export CMAKE_PREFIX_PATH=`pwd`/clib
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
cargo build --features ugoira -vv || exit 1
- name: Test
run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
export CMAKE_PREFIX_PATH=`pwd`/clib
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
cargo test --features ugoira --verbose -- --show-output || exit 1
build-server:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Build
run: cargo build --features server,db_sqlite -vv
- name: Run tests
run: cargo test --features server,db_sqlite --verbose -- --show-output
build-db-all:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Build
run: cargo build --features db_all -vv
- name: Run tests
run: cargo test --features db_all --verbose -- --show-output
build-all:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Get cache key
id: cache_key
run: |
cd scripts
python3 get_cache_key.py exiv2 libzip x264 ffmpeg || exit 1
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: clib/
key: ${{ runner.os }}-${{ steps.cache_key.outputs.cache_key }}
- name: Setup NASM
if: steps.cache.outputs.cache-hit != 'true'
uses: ilammy/setup-nasm@v1
- name: Build thirdparty library
if: steps.cache.outputs.cache-hit != 'true'
run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
cp scripts/build_*.sh -v ./ || exit 1
./build_exiv2.sh || exit 1
./build_libzip.sh || exit 1
./build_x264.sh || exit 1
./build_ffmpeg.sh || exit 1
- name: Build
run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
export CMAKE_PREFIX_PATH=`pwd`/clib
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
cargo build --features all -vv || exit 1
- name: Test
run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
export CMAKE_PREFIX_PATH=`pwd`/clib
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
cargo test --features all --verbose -- --show-output || exit 1
build-win:
runs-on: windows-latest
defaults:
run:
shell: cmd
steps:
- name: Check Out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Get Cache Key
id: cache_key
run: |
cd scripts
python get_cache_key.py --prefix=win zlib pkgconf expat exiv2 openssl libzip x264 ffmpeg || exit 1
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: clib/
key: win-${{ steps.cache_key.outputs.cache_key }}
- name: Install Ninja
run: |
python -m pip install --upgrade ninja
- name: Install Meson
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade meson
- name: Setup CL
uses: ilammy/msvc-dev-cmd@v1
- name: Set up NASM
if: steps.cache.outputs.cache-hit != 'true'
uses: ilammy/[email protected]
- name: Setup MSYS2
if: steps.cache.outputs.cache-hit != 'true'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
base-devel
- name: Build zlib
if: steps.cache.outputs.cache-hit != 'true'
run: |
COPY /Y scripts\build_win_zlib.bat || exit 1
CALL build_win_zlib.bat || exit 1
- name: Build pkgconf
if: steps.cache.outputs.cache-hit != 'true'
run: |
COPY /Y scripts\build_win_pkgconf.bat || exit 1
CALL build_win_pkgconf.bat || exit 1
- name: Build expat
if: steps.cache.outputs.cache-hit != 'true'
run: |
COPY /Y scripts\build_win_expat.bat || exit 1
CALL build_win_expat.bat || exit 1
- name: Build exiv2
if: steps.cache.outputs.cache-hit != 'true'
run: |
COPY /Y scripts\build_win_exiv2.bat || exit 1
CALL build_win_exiv2.bat || exit 1
- name: Build openssl
if: steps.cache.outputs.cache-hit != 'true'
run: |
COPY /Y scripts\build_win_openssl.bat || exit 1
CALL build_win_openssl.bat || exit 1
- name: Build libzip
if: steps.cache.outputs.cache-hit != 'true'
run: |
COPY /Y scripts\build_win_libzip.bat || exit 1
CALL build_win_libzip.bat || exit 1
- name: Build x264
if: steps.cache.outputs.cache-hit != 'true'
shell: msys2 {0}
env:
MSYS2_PATH_TYPE: inherit
run: |
cp scripts/build_win_x264.sh -v ./ || exit 1
./build_win_x264.sh || exit 1
- name: Build ffmpeg
if: steps.cache.outputs.cache-hit != 'true'
shell: msys2 {0}
env:
MSYS2_PATH_TYPE: inherit
run: |
cp scripts/build_win_ffmpeg.sh -v ./ || exit 1
./build_win_ffmpeg.sh || exit 1
- name: Download certs
run: |
COPY /Y scripts\download_certs.bat || exit 1
CALL download_certs.bat || exit 1
- name: Build
run: |
SET PKG_CONFIG_PATH=%CD%\clib\lib\pkgconfig
SET CMAKE_PREFIX_PATH=%CD%\clib
SET PATH=%CD%\clib\bin;%PATH%
SET OPENSSL_LIB_DIR=%CD%\clib\lib
SET OPENSSL_INCLUDE_DIR=%CD%\clib\include
cargo build --features all --profile release-with-debug -vv || exit 1
- name: Download lld-rust
continue-on-error: true
run: |
COPY /Y scripts\download_lld-rust.bat || exit 1
CALL download_lld-rust.bat || exit 1
- name: Package files
continue-on-error: true
run: |
SET PATH=%CD%\clib\bin;%PATH%
COPY /Y clib\ssl\cert.pem cert.pem
python scripts\pack_prog.py -o pixiv_downloader.7z -a cert.pem %CD%/target/release-with-debug/pixiv_downloader.exe || exit 1
python scripts\pack_prog.py -o pixiv_downloader.pdb.7z -p %CD%/target/release-with-debug/pixiv_downloader.exe || exit 1
- name: Upload files
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: pixiv_downloader
path: ./pixiv_downloader.7z
- name: Upload pdb files
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: pixiv_downloader-pdb
path: ./pixiv_downloader.pdb.7z
- name: Test
run: |
SET PKG_CONFIG_PATH=%CD%\clib\lib\pkgconfig
SET CMAKE_PREFIX_PATH=%CD%\clib
SET PATH=%CD%\clib\bin;%PATH%
SET OPENSSL_LIB_DIR=%CD%\clib\lib
SET OPENSSL_INCLUDE_DIR=%CD%\clib\include
cargo test --features all --profile release-with-debug --verbose -- --show-output || exit 1