Skip to content
Merged

ci #77

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
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]
#exclude:
# - build-type: Debug
# 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
#- 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 }} ..
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ..
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

strategy:
matrix:
build-type: [Debug, Release]

steps:
- name: Checkout code
uses: actions/checkout@v4

- 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
- 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: |
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ enable_testing()
cmake_policy(SET CMP0167 NEW)
cmake_policy(SET CMP0135 NEW)

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

# If ENABLE_COVERAGE is defined, try to set coverage flags.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/SRI-CSL/sally.svg?branch=master)](https://travis-ci.org/SRI-CSL/sally)
[![CI](https://github.com/SRI-CSL/sally/workflows/CI/badge.svg)](https://github.com/SRI-CSL/sally/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/SRI-CSL/sally/badge.svg?branch=master)](https://coveralls.io/r/SRI-CSL/sally?branch=master)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/5578/badge.svg)](https://scan.coverity.com/projects/5578)

Expand Down
19 changes: 19 additions & 0 deletions contrib/install_yices2.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
#!/bin/bash
set -e

# Find Homebrew prefix for macOS and set build flags for dependencies
if [[ "$(uname)" == "Darwin" ]]; then
if [ -d /opt/homebrew ]; then
BREW_PREFIX=/opt/homebrew
else
BREW_PREFIX=/usr/local
fi
export CPPFLAGS="-I$BREW_PREFIX/include"
export LDFLAGS="-L$BREW_PREFIX/lib"
export PKG_CONFIG_PATH="$BREW_PREFIX/lib/pkgconfig"
export LD_LIBRARY_PATH="$BREW_PREFIX/lib:$LD_LIBRARY_PATH"
echo "[INFO] macOS build flags set:"
echo "CPPFLAGS=$CPPFLAGS"
echo "LDFLAGS=$LDFLAGS"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
fi

# libpoly
pushd .
git clone https://github.com/SRI-CSL/libpoly.git
Expand All @@ -27,6 +45,7 @@ popd
pushd .
git clone https://github.com/SRI-CSL/yices2.git
cd yices2
export LD_LIBRARY_PATH=/usr/local/lib/:${LD_LIBRARY_PATH}
autoconf
./configure --enable-mcsat
make
Expand Down
Loading