ci #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
# Enable parallel builds | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
jobs: | |
build-and-test-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
build-type: [Debug, Release] | |
enable-coverage: [false, true] | |
include: | |
- build-type: Debug | |
enable-coverage: false | |
- build-type: Release | |
enable-coverage: false | |
- build-type: Release | |
enable-coverage: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/ccache | |
~/.local | |
key: ${{ runner.os }}-deps-${{ hashFiles('**/CMakeLists.txt', '**/package.json', '**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-deps- | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
build-essential \ | |
cmake \ | |
bison \ | |
flex \ | |
libgmp-dev \ | |
libboost-program-options-dev \ | |
libboost-iostreams-dev \ | |
libboost-test-dev \ | |
libboost-thread-dev \ | |
libboost-system-dev \ | |
libreadline-dev \ | |
default-jre \ | |
gperf \ | |
python3-pip \ | |
ccache | |
- name: Setup ccache | |
run: | | |
echo "CCACHE_DIR=$HOME/.cache/ccache" >> $GITHUB_ENV | |
ccache --max-size=1G | |
- name: Install SMT solvers | |
run: | | |
bash contrib/install_yices2.sh | |
bash contrib/install_opensmt2.sh | |
bash contrib/install_dreal4.sh | |
- name: Install coverage tools | |
if: matrix.enable-coverage | |
run: | | |
pip3 install --user cpp-coveralls | |
- name: Configure and build | |
run: | | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_COVERAGE=${{ matrix.enable-coverage }} .. | |
make -j${{ env.CMAKE_BUILD_PARALLEL_LEVEL }} | |
- name: Run tests | |
run: | | |
cd build | |
make check | |
timeout-minutes: 30 | |
- name: Upload coverage to Coveralls | |
if: matrix.enable-coverage | |
run: | | |
cd build | |
coveralls -r .. -b . --gcov-options '\-lp' | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
- name: Show ccache statistics | |
run: ccache -s | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/Library/Caches/Homebrew | |
~/.cache/ccache | |
key: ${{ runner.os }}-deps-${{ hashFiles('**/CMakeLists.txt') }} | |
restore-keys: | | |
${{ runner.os }}-deps- | |
- name: Install dependencies via Homebrew | |
run: | | |
brew update | |
brew install cmake boost gmp bison flex readline ccache autoconf automake libtool | |
- name: Install SMT solvers | |
run: | | |
bash contrib/install_yices2.sh | |
bash contrib/install_opensmt2.sh | |
bash contrib/install_dreal4.sh | |
- name: Set up GMP environment variables (Homebrew) | |
run: | | |
# Find the Homebrew prefix | |
if [ -d /opt/homebrew ]; then | |
BREW_PREFIX=/opt/homebrew | |
else | |
BREW_PREFIX=/usr/local | |
fi | |
echo "LDFLAGS=-L$BREW_PREFIX/lib" >> $GITHUB_ENV | |
echo "CPPFLAGS=-I$BREW_PREFIX/include" >> $GITHUB_ENV | |
echo "PKG_CONFIG_PATH=$BREW_PREFIX/lib/pkgconfig" >> $GITHUB_ENV | |
echo "CMAKE_PREFIX_PATH=$BREW_PREFIX" >> $GITHUB_ENV | |
echo "GMP_HOME=$BREW_PREFIX" >> $GITHUB_ENV | |
# Also export for current shell | |
export LDFLAGS="-L$BREW_PREFIX/lib" | |
export CPPFLAGS="-I$BREW_PREFIX/include" | |
export PKG_CONFIG_PATH="$BREW_PREFIX/lib/pkgconfig" | |
export CMAKE_PREFIX_PATH="$BREW_PREFIX" | |
export GMP_HOME="$BREW_PREFIX" | |
echo "Environment variables set:" | |
echo "LDFLAGS=$LDFLAGS" | |
echo "CPPFLAGS=$CPPFLAGS" | |
echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH" | |
echo "GMP_HOME=$GMP_HOME" | |
- name: Install Java | |
run: | | |
brew install --cask temurin | |
- name: Setup ccache | |
run: | | |
echo "CCACHE_DIR=$HOME/.cache/ccache" >> $GITHUB_ENV | |
ccache --max-size=1G | |
- name: Configure and build | |
run: | | |
# Find the Homebrew prefix again for this step | |
if [ -d /opt/homebrew ]; then | |
BREW_PREFIX=/opt/homebrew | |
else | |
BREW_PREFIX=/usr/local | |
fi | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$BREW_PREFIX .. | |
make -j$(sysctl -n hw.ncpu) | |
- name: Run tests | |
run: | | |
cd build | |
make check | |
timeout-minutes: 30 | |
- name: Show ccache statistics | |
run: ccache -s |