Skip to content

Commit f698ac7

Browse files
authored
ci (#77)
* ci try 1 * update macos ci * update cxx version * fix cudd script for darwin * update macos script * gmp issue on macos * try * try 2 * try 3 * try 4 * try 5 * try 6 * try 7 * try 8 * try 9 * try 10 * try 11 * try 12
1 parent 047c00e commit f698ac7

File tree

4 files changed

+162
-2
lines changed

4 files changed

+162
-2
lines changed

.github/workflows/ci.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
# Enable parallel builds
11+
CMAKE_BUILD_PARALLEL_LEVEL: 4
12+
13+
jobs:
14+
build-and-test-linux:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
build-type: [Debug, Release]
20+
#enable-coverage: [false, true]
21+
#exclude:
22+
# - build-type: Debug
23+
# enable-coverage: true
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Cache dependencies
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.cache/ccache
34+
~/.local
35+
key: ${{ runner.os }}-deps-${{ hashFiles('**/CMakeLists.txt', '**/package.json', '**/requirements.txt') }}
36+
restore-keys: |
37+
${{ runner.os }}-deps-
38+
39+
- name: Install system dependencies
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install -y \
43+
build-essential \
44+
cmake \
45+
bison \
46+
flex \
47+
libgmp-dev \
48+
libboost-program-options-dev \
49+
libboost-iostreams-dev \
50+
libboost-test-dev \
51+
libboost-thread-dev \
52+
libboost-system-dev \
53+
libreadline-dev \
54+
default-jre \
55+
gperf \
56+
python3-pip \
57+
ccache
58+
59+
- name: Setup ccache
60+
run: |
61+
echo "CCACHE_DIR=$HOME/.cache/ccache" >> $GITHUB_ENV
62+
ccache --max-size=1G
63+
64+
- name: Install SMT solvers
65+
run: |
66+
bash contrib/install_yices2.sh
67+
68+
#- name: Install coverage tools
69+
# if: matrix.enable-coverage
70+
# run: |
71+
# pip3 install --user cpp-coveralls
72+
73+
- name: Configure and build
74+
run: |
75+
mkdir -p build
76+
cd build
77+
#cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_COVERAGE=${{ matrix.enable-coverage }} ..
78+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ..
79+
make -j${{ env.CMAKE_BUILD_PARALLEL_LEVEL }}
80+
81+
# - name: Run tests
82+
# run: |
83+
# cd build
84+
# make check
85+
# timeout-minutes: 30
86+
87+
#- name: Upload coverage to Coveralls
88+
# if: matrix.enable-coverage
89+
# run: |
90+
# cd build
91+
# coveralls -r .. -b . --gcov-options '\-lp'
92+
# env:
93+
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
94+
95+
- name: Show ccache statistics
96+
run: ccache -s
97+
98+
build-macos:
99+
runs-on: macos-latest
100+
101+
strategy:
102+
matrix:
103+
build-type: [Debug, Release]
104+
105+
steps:
106+
- name: Checkout code
107+
uses: actions/checkout@v4
108+
109+
- name: Install dependencies via Homebrew
110+
run: |
111+
brew update
112+
brew install cmake boost gmp bison flex readline ccache autoconf automake libtool
113+
114+
- name: Install SMT solvers
115+
run: |
116+
bash contrib/install_yices2.sh
117+
118+
- name: Install Java
119+
run: |
120+
brew install --cask temurin
121+
122+
- name: Setup ccache
123+
run: |
124+
echo "CCACHE_DIR=$HOME/.cache/ccache" >> $GITHUB_ENV
125+
ccache --max-size=1G
126+
127+
- name: Configure and build
128+
run: |
129+
mkdir -p build
130+
cd build
131+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_PREFIX_PATH=$BREW_PREFIX ..
132+
make -j$(sysctl -n hw.ncpu)
133+
134+
- name: Run tests
135+
run: |
136+
cd build
137+
make check
138+
timeout-minutes: 30
139+
140+
- name: Show ccache statistics
141+
run: ccache -s

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ enable_testing()
88
cmake_policy(SET CMP0167 NEW)
99
cmake_policy(SET CMP0135 NEW)
1010

11-
set(CMAKE_CXX_STANDARD 23)
11+
set(CMAKE_CXX_STANDARD 11)
1212
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall")
1313

1414
# If ENABLE_COVERAGE is defined, try to set coverage flags.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/SRI-CSL/sally.svg?branch=master)](https://travis-ci.org/SRI-CSL/sally)
1+
[![CI](https://github.com/SRI-CSL/sally/workflows/CI/badge.svg)](https://github.com/SRI-CSL/sally/actions?query=workflow%3ACI)
22
[![Coverage Status](https://coveralls.io/repos/SRI-CSL/sally/badge.svg?branch=master)](https://coveralls.io/r/SRI-CSL/sally?branch=master)
33
[![Coverity Scan Build Status](https://scan.coverity.com/projects/5578/badge.svg)](https://scan.coverity.com/projects/5578)
44

contrib/install_yices2.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
#!/bin/bash
22
set -e
33

4+
# Find Homebrew prefix for macOS and set build flags for dependencies
5+
if [[ "$(uname)" == "Darwin" ]]; then
6+
if [ -d /opt/homebrew ]; then
7+
BREW_PREFIX=/opt/homebrew
8+
else
9+
BREW_PREFIX=/usr/local
10+
fi
11+
export CPPFLAGS="-I$BREW_PREFIX/include"
12+
export LDFLAGS="-L$BREW_PREFIX/lib"
13+
export PKG_CONFIG_PATH="$BREW_PREFIX/lib/pkgconfig"
14+
export LD_LIBRARY_PATH="$BREW_PREFIX/lib:$LD_LIBRARY_PATH"
15+
echo "[INFO] macOS build flags set:"
16+
echo "CPPFLAGS=$CPPFLAGS"
17+
echo "LDFLAGS=$LDFLAGS"
18+
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
19+
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
20+
fi
21+
422
# libpoly
523
pushd .
624
git clone https://github.com/SRI-CSL/libpoly.git
@@ -27,6 +45,7 @@ popd
2745
pushd .
2846
git clone https://github.com/SRI-CSL/yices2.git
2947
cd yices2
48+
export LD_LIBRARY_PATH=/usr/local/lib/:${LD_LIBRARY_PATH}
3049
autoconf
3150
./configure --enable-mcsat
3251
make

0 commit comments

Comments
 (0)