-
Notifications
You must be signed in to change notification settings - Fork 26
198 lines (171 loc) · 5.84 KB
/
continuous.yaml
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
name: Build
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 1
jobs:
####################
# Linux / macOS
####################
Unix:
name: ${{ matrix.os }} (${{ matrix.compiler }}, ${{ matrix.config }}, ${{ matrix.sanitizer }}Sanitizer)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, macos-14]
config: [RelwithDebInfo, Debug]
compiler: [gcc, apple, llvm]
sanitizer: ["Address", "Thread"] # TODO: Add Memory+Undefined Sanitizer
exclude:
- os: macos-13
compiler: gcc
- os: macos-13
sanitizer: Thread
- os: macos-13
config: Debug
- os: macos-14
compiler: gcc
- os: ubuntu-22.04
compiler: apple
steps:
- name: Free Disk Space
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
if [ "${{ matrix.compiler }}" = "gcc" ]; then
sudo apt-get install -y g++
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
else
sudo apt-get install -y clang
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
fi
sudo apt-get install xorg-dev ccache
- name: Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install ccache
if [ "${{ matrix.compiler }}" = "llvm" ]; then
brew install llvm@17
echo "CC='$(brew --prefix llvm@17)/bin/clang'" >> $GITHUB_ENV
echo "CXX='$(brew --prefix llvm@17)/bin/clang++'" >> $GITHUB_ENV
fi
- name: Setup Xcode version
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Cache Build
id: cache-build
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ matrix.name }}-${{ matrix.config }}-cache
- name: Prepare ccache
run: |
ccache --max-size=1.0G
ccache -V && ccache --show-stats && ccache --zero-stats
- name: Configure
run: |
mkdir -p build
cd build
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DLAGRANGE_JENKINS=ON \
-DLAGRANGE_ALL=ON \
-DLAGRANGE_LIMIT_PARALLELISM=ON \
-DOPENVDB_CORE_SHARED=ON \
-DOPENVDB_CORE_STATIC=OFF \
-DUSE_EXPLICIT_INSTANTIATION=OFF \
-DUSE_SANITIZER="${{ matrix.sanitizer }}"
- name: Build
run: |
cmake --build build -j ${{ steps.cpu-cores.outputs.count }}
ccache --show-stats
- name: Tests
run: cd build; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}
####################
# Windows
####################
Windows:
name: windows-2022 (${{ matrix.config }})
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
config: [Release, Debug]
steps:
- name: Show disk space
run: Get-PSDrive
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Set env variable for sccache
run: |
echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV}
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: ${{ env.appdata }}\Mozilla\sccache
key: ${{ runner.os }}-${{ matrix.config }}-cache
- name: Prepare sccache
run: |
iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop install sccache --global
# Scoop modifies the PATH so we make it available for the next steps of the job
echo "${env:PATH}" >> ${env:GITHUB_PATH}
# We run configure + build in the same step, since they both need to call VsDevCmd
# Also, cmd uses ^ to break commands into multiple lines (in powershell this is `)
- name: Configure and build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
cmake -G Ninja ^
-DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
-DLAGRANGE_JENKINS=ON ^
-DLAGRANGE_ALL=ON ^
-B "C:/build" ^
-S .
cmake --build "C:/build" -j ${{ steps.cpu-cores.outputs.count }}
- name: Tests
run: cd "C:/build"; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}