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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
|
on: [push, pull_request, pull_request_target]
name: CI
jobs:
build:
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
strategy:
matrix:
include:
- name: ubuntu:production
os: ubuntu-latest
config: production --auto-download --all-bindings --editline --docs
cache-key: production
python-bindings: true
build-documentation: true
check-examples: true
exclude_regress: 3-4
run_regression_args: --no-check-unsat-cores --no-check-proofs
- name: macos:production
os: macos-latest
config: production --auto-download --all-bindings --editline
cache-key: production
python-bindings: true
check-examples: true
exclude_regress: 3-4
run_regression_args: --no-check-unsat-cores --no-check-proofs
- name: ubuntu:production-clang
os: ubuntu-latest
env: CC=clang CXX=clang++
config: production --auto-download
cache-key: productionclang
check-examples: true
exclude_regress: 3-4
run_regression_args: --no-check-unsat-cores --no-check-proofs
- name: ubuntu:production-dbg
os: ubuntu-latest
config: production --auto-download --assertions --tracing --unit-testing --editline
cache-key: dbg
exclude_regress: 3-4
run_regression_args: --no-check-unsat-cores
- name: ubuntu:production-dbg-clang
os: ubuntu-latest
env: CC=clang CXX=clang++
config: production --auto-download --assertions --tracing --unit-testing --cln --gpl
cache-key: dbgclang
exclude_regress: 3-4
run_regression_args: --no-check-proofs
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Packages
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
ccache \
libcln-dev \
libgmp-dev \
libgtest-dev \
libedit-dev \
flex \
libfl-dev \
flexc++
python3 -m pip install toml
python3 -m pip install setuptools
python3 -m pip install pexpect
cd /usr/src/googletest
sudo cmake .
sudo cmake --build . --target install
cd -
echo "/usr/lib/ccache" >> $GITHUB_PATH
# Note: macOS comes with a libedit; it does not need to brew-installed
- name: Install Packages (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install \
ccache \
cln \
gmp \
pkgconfig \
flex
python3 -m pip install toml
python3 -m pip install setuptools
python3 -m pip install pexpect
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
- name: Install Python Dependencies
if: matrix.python-bindings
run: |
python3 -m pip install pytest
python3 -m pytest --version
python3 -m pip install \
Cython==0.29.* --install-option="--no-cython-compile"
echo "$(python3 -m site --user-base)/bin" >> $GITHUB_PATH
- name: Install Documentation Dependencies
if: matrix.build-documentation
run: |
sudo apt-get install -y doxygen python3-docutils python3-jinja2
python3 -m pip install \
sphinxcontrib-bibtex sphinx-tabs sphinx-rtd-theme breathe
# The GitHub action for caching currently does not support modifying an
# already existing cache. We thus have a few different possibilities:
# - If having (partially) outdated data in the cached directory is fine, we
# may want to restore any old cache via `restore-keys`. We should try hard
# to detect that we have (partially) outdated data and make sure that the
# updated data is stored to a new cache key.
# - If a cache is updated frequently (i.e. almost with every commit), we
# should use the current commit hash as suffix and use `restore-keys` to
# restore the cache from the previous commit.
#
# We define three caches: aux-tools, ccache, deps.
# - aux-tools (deps/) does not handle outdated contents gracefully. As it is
# not updated frequently, we completely rebuild it whenever it might
# change, which is when the contrib scripts or the CI config changes.
# - ccache changes with (almost) every commit and handles outdated contents
# properly. We thus use `restore-keys` and store a new cache for every
# commit.
# - deps (build/deps/) does handle outdated contents gracefully, but does
# not change frequently. We thus use `restore-keys` to restore any recent
# cache, but only store a new cache if the cmake or CI config changes.
#
# All caches are separated by operating system. Both ccache and deps are
# additionally separated by `cache-key`, i.e. the CI job type, because they
# depend on the configured compiler.
- name: Restore Auxiliary Tools
id: restore-aux-tools
uses: actions/cache@v2
with:
path: deps/install
key: cvc5-aux-tools-${{ runner.os }}-${{ hashFiles('contrib/get-**') }}-${{ hashFiles('.github/workflows/ci.yml') }}
- name: Setup Auxiliary Tools
if: steps.restore-aux-tools.outputs.cache-hit != 'true'
run: |
./contrib/get-lfsc-checker
- name: Restore ccache
id: ccache
uses: actions/cache@v2
with:
path: ccache-dir
key: cvc5-ccache-${{ runner.os }}-${{ matrix.cache-key }}-${{ github.sha }}
restore-keys: cvc5-ccache-${{ runner.os }}-${{ matrix.cache-key }}-
- name: Configure ccache
run: |
ccache --set-config=cache_dir=${{ github.workspace }}/ccache-dir
ccache --set-config=compression=true
ccache --set-config=compression_level=6
ccache -M 500M
ccache -z
- name: Restore Dependencies
id: restore-deps
uses: actions/cache@v2
with:
path: build/deps
key: cvc5-deps-${{ runner.os }}-${{ matrix.cache-key }}-${{ hashFiles('cmake/Find**', 'cmake/deps-helper.cmake') }}-${{ hashFiles('.github/workflows/ci.yml') }}
- name: Configure
run: |
${{ matrix.env }} ./configure.sh ${{ matrix.config }} \
--prefix=$(pwd)/build/install \
--unit-testing \
--werror
- name: Build
run: make -j2
working-directory: build
- name: ccache Statistics
run: ccache -s
- name: Run CTest
run: make -j2 check
env:
ARGS: --output-on-failure -LE regress[${{ matrix.exclude_regress }}]
CVC5_REGRESSION_ARGS: --no-early-exit
RUN_REGRESSION_ARGS: ${{ matrix.run_regression_args }}
working-directory: build
- name: Install Check
run: |
make -j2 install
echo -e "#include <cvc5/cvc5.h>\nint main() { cvc5::api::Solver s; return 0; }" > /tmp/test.cpp
g++ -std=c++11 /tmp/test.cpp -I install/include -L install/lib -lcvc5
working-directory: build
- name: Python Install Check
if: matrix.python-bindings
run: |
export PYTHONPATH="$PYTHONPATH:$(dirname $(find build/install/ -name "pycvc5" -type d))"
python3 -c "import pycvc5"
# Examples are built for non-symfpu builds
- name: Check Examples
if: matrix.check-examples && runner.os == 'Linux'
run: |
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=$(pwd)/../../build/install/lib/cmake
make -j2
ctest -j2 --output-on-failure
working-directory: examples
- name: Build Documentation
if: matrix.build-documentation
run: make -j2 docs-gh
working-directory: build
- name: Store Documentation
if: matrix.build-documentation
uses: actions/upload-artifact@v2
with:
name: documentation
path: build/docs/sphinx-gh/
upload-docs:
if: github.event_name == 'push' || github.event_name == 'pull_request_target'
name: upload-docs
runs-on: ubuntu-latest
continue-on-error: true
needs: build
steps:
- name: Setup Deploy Key
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.CVC5_DOCS_TOKEN }}"
- name: Setup Context
run: |
if [ "${{ github.event_name }}" == "push" ] ; then
NAME=$(echo "${GITHUB_REF}" | sed "s,refs/heads/,,")
HASH=${{ github.sha }}
echo "Identified branch $NAME"
elif [ "${{ github.event_name }}" == "pull_request_target" ] ; then
NAME="${{ github.event.number }}"
HASH="${{ github.event.pull_request.head.sha }}"
echo "Identified PR #$NAME (from $HASH)"
NAME="pr$NAME"
fi
echo "NAME=$NAME" >> $GITHUB_ENV
echo "HASH=$HASH" >> $GITHUB_ENV
- name: Clone Documentation Repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
git config --global user.email "docbot@cvc5"
git config --global user.name "DocBot"
git clone git@github.com:cvc5/docs-ci.git target/
- name: Fetch artifact
uses: actions/download-artifact@v2
with:
name: documentation
path: docs-new
- name: Update docs
continue-on-error: true
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
if [ -n "$NAME" ]; then
mv docs-new target/docs-$NAME-$HASH
cd target/
rm -f docs-$NAME
ln -s docs-$NAME-$HASH docs-$NAME
git add docs-$NAME docs-$NAME-$HASH
python3 genindex.py
git add README.md
git commit -m "Update docs for $NAME"
git push
else
echo "Ignored run"
fi
|