generated from allen-cell-animated/github-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 7
204 lines (200 loc) · 6.81 KB
/
build_and_test.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
name: C++ Build
on:
push:
branches-ignore:
- "master"
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
pre-build-command: "apt-get --allow-releaseinfo-change update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended"
build-command: "make latexpdf"
- uses: actions/upload-artifact@v4
with:
name: DocumentationHTML
path: docs/_build/html/
- uses: actions/upload-artifact@v4
with:
name: DocumentationPDF
path: docs/_build/latex/agave.pdf
docs_pythonclient:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: ammaraskar/sphinx-action@master
with:
pre-build-command: "pip install -e agave_pyclient/"
docs-folder: "agave_pyclient/docs/"
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "agave_pyclient/docs/"
pre-build-command: "pip install -e agave_pyclient/ && apt-get --allow-releaseinfo-change update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended"
build-command: "make latexpdf"
- uses: actions/upload-artifact@v4
with:
name: DocumentationPythonClientHTML
path: agave_pyclient/docs/_build/html/
- uses: actions/upload-artifact@v4
with:
name: DocumentationPythonClientPDF
path: agave_pyclient/docs/_build/latex/agave_pyclient.pdf
cmake-build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: agave-linux
- os: windows-latest
# Revert to windows-latest after: https://github.com/actions/runner-images/issues/7662
artifact: agave-win
# note macos-14 is arm64 and macos-13 is x86_64
- os: macos-14
artifact: agave-macos-arm64
- os: macos-13
artifact: agave-macos-x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.3
modules: qtwebsockets qtimageformats
- name: macos install deps
if: contains(matrix.os, 'macos')
env:
CC: clang
CXX: clang++
run: |
export MACOSX_DEPLOYMENT_TARGET=10.15
brew install spdlog glm libtiff nasm zstd ninja
- name: macos build and test
if: contains(matrix.os, 'macos')
env:
CC: clang
CXX: clang++
run: |
export MACOSX_DEPLOYMENT_TARGET=10.15
mkdir ./build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build . --target agave_test --config Release
cmake --build . --config Release
cpack -D CPACK_PACKAGE_FILE_NAME=${{ matrix.artifact }}
shell: bash
- name: Upload mac artifact
if: contains(matrix.os, 'macos')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ./build/${{ matrix.artifact }}.dmg
- name: linux install deps
if: matrix.os == 'ubuntu-latest'
env:
CC: gcc
CXX: g++
run: |
sudo apt-get install ninja-build libspdlog-dev libglm-dev libgl1-mesa-dev libegl1-mesa-dev libtiff-dev libzstd-dev nasm
- name: linux build and test
if: matrix.os == 'ubuntu-latest'
env:
CC: gcc-10
CXX: g++-10
run: |
mkdir ./build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build . --target agave_test --config Release
cmake --build . --target install --config Release
shell: bash
- name: windows install ninja
if: matrix.os == 'windows-latest'
run: |
choco install ninja
- name: Configure MSVC console (Windows)
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: windows install deps
if: matrix.os == 'windows-latest'
env:
vc_arch: "x64"
CXX: cl.exe
CC: cl.exe
run: |
vcpkg install --triplet x64-windows tiff glm zlib libjpeg-turbo liblzma spdlog zstd eigen3
- name: windows get nasm
if: matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1
- name: Remove bad Strawberry Perl patch binary in search path
# https://github.com/actions/runner-images/issues/5459#issuecomment-1532856844
if: matrix.os == 'windows-latest'
run: del C:\Strawberry\c\bin\patch.EXE
- name: windows build and test
if: matrix.os == 'windows-latest'
env:
vc_arch: "x64"
CXX: cl.exe
CC: cl.exe
run: |
mkdir build
cd build
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel --target agave_test --config Release
cmake --build . --parallel --config Release
cpack -D CPACK_PACKAGE_FILE_NAME=${{ matrix.artifact }}
shell: cmd
- name: Upload windows artifact
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ./build/${{ matrix.artifact }}.exe
lint-and-test-webclient:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: |
cd webclient
npm ci
npm run lint
npm run typeCheck
npm run test --if-present
lint-and-test-pyclient:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
cd agave_pyclient
pip install .[test]
- name: Lint with flake8
run: |
cd agave_pyclient
flake8 agave_pyclient --count --verbose --show-source --statistics
black --check --exclude vendor agave_pyclient
pytest agave_pyclient/tests/