-
Notifications
You must be signed in to change notification settings - Fork 42
229 lines (226 loc) · 8.35 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
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
jobs:
build-linux:
runs-on: ubuntu-latest
# 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
steps:
- name: checkout
uses: actions/checkout@v3
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
steps:
- name: checkout
uses: actions/checkout@v3
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
steps:
- name: checkout
uses: actions/checkout@v3
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: vs2017
NANOEM_TARGET_TOOLSET: v141
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=vs2017 `
-G"Visual Studio 17 2022" `
-Tv141 `
../..
cmake --build . --config release
- name: test nanoem's unit tests
run: |
cd ${{ env.NANOEM_BUILD_ARTIFACT_DIRECTORY }}
ctest
build-rust:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}/rust
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup prerequisite packages
run: |
sudo apt-get update && sudo apt-get install -y \
protobuf-compiler
- name: setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: build plugin_wasm
run: ./scripts/build.sh
codeql:
if: ${{ false }}
runs-on: ubuntu-latest
env:
FX9_BUILD_DEPENDENCIES_DIRECTORY: ${{ github.workspace }}/out/dependencies
NANOEM_BUILD_DEPENDENCIES_DIRECTORY: ${{ github.workspace }}/out/dependencies
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: cpp
config-file: ${{ github.workspace }}/.github/codeql/codeql-config.yml
- 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 glfw
run: git clone https://github.com/glfw/glfw.git dependencies/glfw
- name: build all dependencies of nanoem
run: |
cd ${{ github.workspace }}
cmake -DCONFIG=release -P $PWD/scripts/build.cmake
env:
NANOEM_TARGET_ARCHITECTURES: x86_64
NANOEM_TARGET_CONFIGURATIONS: "debug;release"
NANOEM_TARGET_COMPILER: gcc
NANOEM_DISABLE_BUILD_SENTRY_NATIVE: 1
NANOEM_DISABLE_BUILD_SPIRV_TOOLS: 1
- name: autobuild
uses: github/codeql-action/autobuild@v1
- name: perform CodeQL Analysis
uses: github/codeql-action/analyze@v1