forked from hkrn/nanoem
-
Notifications
You must be signed in to change notification settings - Fork 0
275 lines (271 loc) · 10.5 KB
/
main.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
FFMPEG_VERSION_TAG: n4.4.1
FX9_BUILD_DEPENDENCIES_DIRECTORY: ${{ github.workspace }}/out/dependencies
GLFW_VERSION_TAG: 3.3.8
ICU_VERSION_TAG: release-71-1
NANOEM_BUILD_DEPENDENCIES_DIRECTORY: ${{ github.workspace }}/out/dependencies
NANOEM_BUILD_ARTIFACT_DIRECTORY: ${{ github.workspace }}/out/core
NANOEM_RUST_DIRECTORY: ${{ github.workspace }}/rust
permissions:
contents: read
jobs:
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 30
# libc++/libc++abi are not prerequsite libraries but specifies to test CXXFLAGS/LDFLAGS are functional
env:
CC: clang
CXX: clang++
CXXFLAGS: -stdlib=libc++
LDFLAGS: -lc++abi
GIT_CLONE_PROTECTION_ACTIVE: false
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive
# Assumes clang/cmake/libc++/libc++abi are installed on GitHub Actions Runner
- name: setup prerequisite packages
run: |
sudo apt-get update && sudo apt-get install -y \
libasound-dev \
libgtk-3-dev \
libglu1-mesa-dev \
ninja-build \
xorg-dev \
libxi-dev \
libxcursor-dev
- name: checkout ffmpeg
run: git clone --depth=1 --branch=${{ env.FFMPEG_VERSION_TAG }} https://github.com/ffmpeg/ffmpeg.git dependencies/ffmpeg
- name: checkout glfw
run: git clone --depth=1 --branch=${{ env.GLFW_VERSION_TAG }} https://github.com/glfw/glfw.git dependencies/glfw
- name: checkout ICU
run: git clone --depth=1 --branch=${{ env.ICU_VERSION_TAG }} https://github.com/unicode-org/icu.git dependencies/icu
- name: build all dependencies of nanoem
run: cmake -DCONFIG=release -P ${{ github.workspace }}/scripts/build.cmake
env:
NANOEM_ENABLE_BUILD_FFMPEG: 1
NANOEM_ENABLE_BUILD_GLFW: 1
NANOEM_ENABLE_BUILD_ICU4C: 1
NANOEM_ENABLE_BUILD_MIMALLOC: 1
NANOEM_TARGET_ARCHITECTURES: x86_64
NANOEM_TARGET_CONFIGURATIONS: "debug;release"
NANOEM_TARGET_COMPILER: clang
- name: build nanoem itself
run: |
mkdir -p ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
cd ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
cmake \
-DCMAKE_INSTALL_PREFIX=${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}/install-root \
-DFX9_ENABLE_OPTIMIZER=OFF \
-DNANOEM_ENABLE_BULLET=ON \
-DNANOEM_ENABLE_GLFW=ON \
-DNANOEM_ENABLE_ICU=ON \
-DNANOEM_ENABLE_IMGUI_FILE_DIALOG=ON \
-DNANOEM_ENABLE_MIMALLOC=ON \
-DNANOEM_ENABLE_NMD=ON \
-DNANOEM_ENABLE_TBB=OFF \
-DNANOEM_ENABLE_TEST=ON \
-DNANOEM_INSTALL_EFFECT_PLUGIN=ON \
-DNANOEM_INSTALL_FFMPEG_PLUGIN=ON \
-DNANOEM_INSTALL_GIF_PLUGIN=OFF \
-DNANOEM_INSTALL_LSMASH_PLUGIN=ON \
-DNANOEM_TARGET_COMPILER=clang \
-GNinja \
../..
cmake --build . --config release
- name: test nanoem's unit tests
run: |
cd ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
ctest
build-macos:
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive
- name: checkout ffmpeg
run: git clone --depth=1 --branch=${{ env.FFMPEG_VERSION_TAG }} https://github.com/ffmpeg/ffmpeg.git dependencies/ffmpeg
- name: checkout ICU
run: git clone --depth=1 --branch=${{ env.ICU_VERSION_TAG }} https://github.com/unicode-org/icu.git dependencies/icu
- name: setup prerequisite packages
run: brew install ninja
- name: build all dependencies of nanoem
run: cmake -DCONFIG=release -P ${{ github.workspace }}/scripts/build.cmake
env:
NANOEM_TARGET_CONFIGURATIONS: "debug;release"
NANOEM_TARGET_COMPILER: clang
NANOEM_ENABLE_BUILD_FFMPEG: 1
NANOEM_ENABLE_BUILD_ICU4C: 1
NANOEM_ENABLE_BUILD_MIMALLOC: 1
- name: build nanoem itself
run: |
mkdir -p ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
cd ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
cmake \
-DCMAKE_INSTALL_PREFIX=${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}/install-root \
-DFX9_ENABLE_OPTIMIZER=OFF \
-DNANOEM_ENABLE_BULLET=ON \
-DNANOEM_ENABLE_ICU=ON \
-DNANOEM_ENABLE_MIMALLOC=ON \
-DNANOEM_ENABLE_NMD=ON \
-DNANOEM_ENABLE_TEST=ON \
-DNANOEM_INSTALL_EFFECT_PLUGIN=ON \
-DNANOEM_INSTALL_FFMPEG_PLUGIN=ON \
-DNANOEM_INSTALL_GIF_PLUGIN=OFF \
-DNANOEM_INSTALL_LSMASH_PLUGIN=ON \
-DNANOEM_TARGET_COMPILER=clang \
-GNinja \
../..
cmake --build . --config release
- name: test nanoem's unit tests
run: |
cd ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
ctest
build-windows:
runs-on: windows-2022
timeout-minutes: 30
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
submodules: recursive
- name: build all dependencies of nanoem
run: cmake -DCONFIG=release -P ${{ github.workspace }}/scripts/build.cmake
env:
NANOEM_TARGET_ARCHITECTURES: x86_64
NANOEM_TARGET_CONFIGURATIONS: "debug;release"
NANOEM_TARGET_COMPILER: vs2019
NANOEM_TARGET_TOOLSET: v142
NANOEM_ENABLE_BUILD_MIMALLOC: 1
- name: build nanoem itself
run: |
mkdir -p ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
cd ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
cmake `
-DCMAKE_INSTALL_PREFIX="${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}/install-root" `
-DFX9_ENABLE_OPTIMIZER=OFF `
-DNANOEM_ENABLE_BULLET=ON `
-DNANOEM_ENABLE_MIMALLOC=ON `
-DNANOEM_ENABLE_NMD=ON `
-DNANOEM_ENABLE_TEST=ON `
-DNANOEM_INSTALL_EFFECT_PLUGIN=ON `
-DNANOEM_INSTALL_FFMPEG_PLUGIN=OFF `
-DNANOEM_INSTALL_GIF_PLUGIN=OFF `
-DNANOEM_INSTALL_LSMASH_PLUGIN=ON `
-DNANOEM_TARGET_COMPILER=vs2019 `
-G"Visual Studio 17 2022" `
-Tv142 `
../..
cmake --build . --config release
- name: test nanoem's unit tests
run: |
cd ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
ctest
build-rust:
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: ${{ env.NANOEM_RUST_DIRECTORY }}
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: setup cargo-deny
uses: EmbarkStudios/cargo-deny-action@3f4a782664881cf5725d0ffd23969fcce89fd868 # v1.6.3
with:
manifest-path: ./rust/Cargo.toml
- name: setup rust toolchain (stable and wasm32-wasi)
uses: actions-rust-lang/setup-rust-toolchain@1fbea72663f6d4c03efaab13560c8a24cfd2a7cc # v1.9.0
with:
cache-workspaces: ${{ env.NANOEM_RUST_DIRECTORY }}
components: rustfmt
target: wasm32-wasi
- name: run rustfmt for check
uses: actions-rust-lang/rustfmt@2d1d4e9f72379428552fa1def0b898733fb8472d # v1.1.0
with:
manifest-path: ${{ env.NANOEM_RUST_DIRECTORY }}/Cargo.toml
- name: setup prerequisite packages
run: |
sudo apt-get update && sudo apt-get install -y \
protobuf-compiler
- name: build plugin_wasm and its test WASMs
run: |
profiles=('dev' 'release-lto')
packages=(
'plugin_wasm_test_model_minimum'
'plugin_wasm_test_motion_minimum'
'plugin_wasm_test_model_full'
'plugin_wasm_test_motion_full'
)
for profile in "${profiles[@]}"; do
for package in "${packages[@]}"; do
cargo build --profile "${profile}" --package "${package}" --target wasm32-wasi
done
done
cargo check --profile release-lto
cargo test --profile release-lto
codeql:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
security-events: write
timeout-minutes: 60
env:
CC: clang
CXX: clang++
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive
- name: initialize CodeQL
uses: github/codeql-action/init@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
with:
config-file: ${{ github.workspace }}/.github/codeql/codeql-config.yml
languages: c-cpp
- name: setup prerequisite packages
run: |
sudo apt-get update && sudo apt-get install -y \
cmake \
libasound-dev \
libicu-dev \
libgtk-3-dev \
libglu1-mesa-dev \
ninja-build \
xorg-dev \
libxi-dev \
libxcursor-dev
- name: checkout ffmpeg
run: git clone --depth=1 --branch=${{ env.FFMPEG_VERSION_TAG }} https://github.com/ffmpeg/ffmpeg.git dependencies/ffmpeg
- name: checkout glfw
run: git clone --depth=1 --branch=${{ env.GLFW_VERSION_TAG }} https://github.com/glfw/glfw.git dependencies/glfw
- name: checkout ICU
run: git clone --depth=1 --branch=${{ env.ICU_VERSION_TAG }} https://github.com/unicode-org/icu.git dependencies/icu
- name: build all dependencies of nanoem
run: |
cd ${{ github.workspace }}
cmake -DCONFIG=release -P "$PWD/scripts/build.cmake"
env:
NANOEM_ENABLE_BUILD_FFMPEG: 1
NANOEM_ENABLE_BUILD_GLFW: 1
NANOEM_ENABLE_BUILD_ICU4C: 1
NANOEM_ENABLE_BUILD_MIMALLOC: 1
NANOEM_TARGET_ARCHITECTURES: x86_64
NANOEM_TARGET_CONFIGURATIONS: "debug;release"
NANOEM_TARGET_COMPILER: clang
- name: autobuild
uses: github/codeql-action/autobuild@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
env:
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false
- name: perform CodeQL Analysis
uses: github/codeql-action/analyze@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12