-
Notifications
You must be signed in to change notification settings - Fork 154
248 lines (216 loc) · 8.62 KB
/
cmake.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
name: Integrated Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Check if is release commit
id: is-release-step
uses: mstachniuk/[email protected]
with:
commit-filter: '[release]'
outputs:
deploy: ${{ steps.is-release-step.outputs.ci-skip }}
vcpkg: true
build:
strategy:
fail-fast: false
matrix:
include:
- label: x86_64-linux-cpu
os: ubuntu-20.04
triplet: x64-linux
cxx: g++-9
gpu: cpu
pkgext: tar.gz
- label: x86_64-windows-cpu
os: windows-2019
triplet: x64-windows
gpu: cpu
pkgext: zip
- label: x86_64-linux-cuda
os: ubuntu-20.04
triplet: x64-linux
cxx: g++-10
gpu: cuda
pkgext: tar.gz
- label: x86_64-windows-cuda
os: windows-2019
triplet: x64-windows
gpu: cuda
pkgext: zip
runs-on: ${{ matrix.os }}
needs: [check]
env:
CXX: ${{ matrix.cxx }}
VCPKG_DEFAULT_TRIPLET: ${{ needs.check.outputs.vcpkg == 'true' && matrix.triplet || '' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 5.15.2
cached: ${{ steps.cache-qt.outputs.cache-hit }}
setup-python: true
- name: Install CUDA toolkit (Windows)
if: ${{ matrix.gpu == 'cuda' && runner.os == 'Windows' }}
env:
cuda: 11.7.1
visual_studio: "Visual Studio 16 2019"
shell: powershell
run: .\misc\ci\win\install_cuda_windows.ps1
- name: Install CUDA toolkit (Ubuntu)
if: ${{ matrix.gpu == 'cuda' && runner.os == 'Linux' }}
env:
cuda: 11.7.1
shell: bash
run: ./misc/ci/nix/install_cuda_ubuntu.sh
- name: Check CUDA toolkit (Windows)
if: ${{ matrix.gpu == 'cuda' && runner.os == 'Windows' }}
shell: powershell
run: |
ls $env:CUDA_PATH
ls $env:CUDA_PATH\bin
ls $env:CUDA_PATH\lib
ls $env:CUDA_PATH\lib\cmake
ls $env:CUDA_PATH\lib\x64
echo "PATH is $($env:PATH)"
nvcc -V
python misc/ci/fuckwenpath.py
- name: Check CUDA toolkit (Ubuntu)
if: ${{ matrix.gpu == 'cuda' && runner.os == 'Linux' }}
shell: bash
run: |
nvcc -V
which nvcc
- name: Setup Dependencies
if: ${{ needs.check.outputs.vcpkg == 'true' }}
run: python misc/ci/setup.py
- name: Setup Vcpkg
uses: lukka/run-vcpkg@v10
if: ${{ needs.check.outputs.vcpkg == 'true' }}
with:
vcpkgGitCommitId: 7e7c62d863b1bf599c1d104b76cd8b74475844d4
vcpkgDirectory: ${{ github.workspace }}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'
runVcpkgInstall: true
- name: Run CMake
id: run_cmake
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ (needs.check.outputs.vcpkg == 'true' && (matrix.gpu == 'cuda' && 'cuda' || 'default') || 'basic') }}
buildPreset: default
- name: Process CMake Error
if: ${{ (failure() && steps.run_cmake.outcome == 'failure') }}
#if: ${{ (failure() && steps.run_cmake.outcome == 'failure') || success() }}
working-directory: ${{ github.workspace }}
shell: bash
run: |
if [[ -f "build/CMakeFiles/CMakeOutput.log" ]]; then
echo "---- build/CMakeFiles/CMakeOutput.log"
cat build/CMakeFiles/CMakeOutput.log
echo "----"
fi
if [[ -f "build/CMakeFiles/CMakeError.log" ]]; then
echo "---- build/CMakeFiles/CMakeError.log"
cat build/CMakeFiles/CMakeError.log
echo "----"
fi
if [[ -f "build/CMakeCache.txt" ]]; then
echo "---- build/CMakeCache.txt"
cat build/CMakeCache.txt
echo "----"
fi
- name: Packaging
if: ${{ needs.check.outputs.deploy == 'true' }}
run: python misc/ci/package.py
- name: Upload Release Artifact
if: ${{ needs.check.outputs.deploy == 'true' }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.label }}-Package
path: ${{github.workspace}}/build/out.${{ matrix.pkgext }}
release:
if: ${{ needs.check.outputs.deploy == 'true' }}
needs: [check, build]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Versioning
id: versioning
shell: python
run: |
import datetime
d = datetime.datetime.now()
print('::set-output name=version::{}.{}.{}'.format(d.year, d.month, d.day))
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
tag_name: ${{ steps.versioning.outputs.version }}
release_name: ${{ steps.versioning.outputs.version }}
body: "(Automated Release by Github Actions / 由 GitHub CI/CD 自动发布)\n\n- branch `${{ github.ref }}`\n- commit `${{ github.sha }}`\n- message `${{ github.event.head_commit.message }}`\n- version `${{ steps.versioning.outputs.version }}`\n\n- Windows: After download, extract the zip file to a directory, then double-click the file `000_start.bat` in that directory to start our application. Alternatively you may manually run `zenoedit.exe`. If you encounter bugs, please let us know by submitting a [Github Issue](https://github.com/zenustech/zeno/issues), thank for your support!\n- Linux: Our released binary support Ubuntu 20.04 and above, otherwise please build from source. Extract the downloaded tar.gz to a directory, then run `bash 000_start.sh` in that directory to start our application. Alternatively you may manually run `usr/bin/zenoedit` in there. Try `chmod +x usr/bin/*` if they don't have execute permission.\n- Windows: 下载后,把 zip 文件解压到一个目录,然后双击其中的 `000_start.bat` 这个文件,即可启动我们的程序。此外您也可以找到 `zenoedit.exe` 直接双击运行。如果您遇到了 BUG,请通过提交 [Github Issue](https://github.com/zenustech/zeno/issues) 的方式来反馈给我们, 感谢您的支持!\n- Linux: 我们发布的二进制版支持 Ubuntu 20.04 以上的系统,否则请从源码构建。把下载的 tar.gz 文件解压到一个目录,然后在那个目录中运行命令 `bash 000_start.sh` 即可启动我们的程序。此外您也可以直接运行其中的 `usr/bin/zenoedit`。如果遇到没有执行权限的问题可以试试看 `chmod +x usr/bin/*`。"
outputs:
version: ${{ steps.versioning.outputs.version }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
deploy:
strategy:
matrix:
include:
- label: x86_64-linux-cpu
pkgext: tar.gz
- label: x86_64-windows-cpu
pkgext: zip
- label: x86_64-linux-cuda
pkgext: tar.gz
- label: x86_64-windows-cuda
pkgext: zip
if: ${{ needs.check.outputs.deploy == 'true' }}
needs: [check, build, release]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Download Release Artifact
uses: actions/download-artifact@v2
with:
name: ${{ matrix.label }}-Package
path: ${{ github.workspace }}/release-artifact
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{github.workspace}}/release-artifact/out.${{ matrix.pkgext }}
asset_name: zeno-${{ needs.release.outputs.version }}-${{ matrix.label }}.${{ matrix.pkgext }}
asset_content_type: ${{ matrix.pkgext == 'tar.gz' && 'application/x-gzip' || 'application/zip' }}
- name: Upload To Server
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.REMOTE_SSH_KEY }}
ARGS: '-rltgoDzvO --delete'
SOURCE: release-artifact/out.${{ matrix.pkgext }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}/zeno-${{ needs.release.outputs.version }}-${{ matrix.label }}.${{ matrix.pkgext }}