Skip to content
Open
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
146 changes: 146 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: CI

on:
pull_request:
push:

permissions:
contents: read

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
YICES_REF: yices-2.7.0

jobs:
unix:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest

steps:
- uses: actions/checkout@v5

- name: Checkout Yices
uses: actions/checkout@v5
with:
repository: SRI-CSL/yices2
ref: ${{ env.YICES_REF }}
path: y2
fetch-depth: 1
sparse-checkout: |
Makefile
Makefile.build
configure
configure.ac
config.guess
config.sub
gmaketest
install-sh
make.include.in
autoconf
configs
scripts
src
utils
sparse-checkout-cone-mode: false

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"

- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ant autoconf automake g++ gcc gperf libgmp-dev libtool m4 make pkg-config

- name: Install macOS dependencies
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
run: |
brew install ant autoconf automake gmp gperf libtool make pkg-config

- name: Build and test
env:
YICES_SRC: ${{ github.workspace }}/y2
YICES_PREFIX: ${{ runner.temp }}/yices-install
run: bash scripts/ci-build-test-unix.sh

windows:
name: windows-latest
runs-on: windows-latest

steps:
- run: git config --system core.longpaths true

- run: git config --global core.autocrlf false && git config --global core.eol lf

- uses: actions/checkout@v5

- name: Checkout Yices
uses: actions/checkout@v5
with:
repository: SRI-CSL/yices2
ref: ${{ env.YICES_REF }}
path: y2
fetch-depth: 1
sparse-checkout: |
Makefile
Makefile.build
configure
configure.ac
config.guess
config.sub
gmaketest
install-sh
make.include.in
autoconf
configs
scripts
src
utils
sparse-checkout-cone-mode: false

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"

- name: Install Ant
shell: powershell
run: choco install ant -y

- name: Install Cygwin dependencies
uses: cygwin/cygwin-install-action@v4
with:
packages: |
autoconf,
automake,
cmake,
coreutils,
curl,
gperf,
libtool,
m4,
make,
mingw64-x86_64-gcc-core,
mingw64-x86_64-gcc-g++,
moreutils,
wget

- name: Build and test
shell: bash
env:
CYGWIN: winsymlinks:native binmode
YICES_SRC: ${{ github.workspace }}/y2
YICES_PREFIX: /tmp/yices-install
run: bash scripts/ci-build-test-windows.sh
4 changes: 3 additions & 1 deletion ant.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash

#uses the build.sh to mimic what 'ant install' does without 'ant'
set -e

REPO_ROOT=${PWD}

YC=${REPO_ROOT}/build/classes
YI=${REPO_ROOT}/dist/lib

YICES_CLASSPATH=${YC} YICES_JNI=${YI} ./build.sh

jar -cvfm ${YI}/yices.jar ${REPO_ROOT}/MANIFEST.txt -C ${YC} ${YC}/com/sri/yices/*.class
jar -cvfm ${YI}/yices.jar ${REPO_ROOT}/MANIFEST.txt -C ${YC} .

java -Djava.library.path=${REPO_ROOT}/dist/lib -jar ${REPO_ROOT}/dist/lib/yices.jar
7 changes: 4 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
<echo> Executing "make ${library}" in ${code} </echo>
<exec executable="make"
dir="${code}"
failifexecutionfails="true">
failonerror="true">
<arg line="${library}"/>
</exec>

Expand All @@ -233,7 +233,7 @@

<exec executable="make"
dir="${code}"
failifexecutionfails="true">
failonerror="true">
<arg line="install"/>
</exec>

Expand All @@ -250,7 +250,7 @@

<exec executable="make"
dir="${code}"
failifexecutionfails="true">
failonerror="true">
<arg line="clean"/>
</exec>
</target>
Expand Down Expand Up @@ -286,6 +286,7 @@
<test name="com.sri.yices.TestTypes"/>
<test name="com.sri.yices.TestYices"/>
<test name="com.sri.yices.TestModels"/>
<test name="com.sri.yices.TestTermComponents"/>
<!-- <test name="com.sri.yices.TestDelegates"/> -->
<!-- <test name="com.sri.yices.TestDimacs"/> -->
<test name="com.sri.yices.TestThreads"/>
Expand Down
58 changes: 58 additions & 0 deletions scripts/ci-build-test-unix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash

set -euo pipefail

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
YICES_SRC="${YICES_SRC:?set YICES_SRC}"
YICES_PREFIX="${YICES_PREFIX:?set YICES_PREFIX}"

configure_brew_env() {
if [[ "$(uname)" != "Darwin" ]]; then
return
fi

local brew_prefix
if [[ -d /opt/homebrew ]]; then
brew_prefix=/opt/homebrew
else
brew_prefix=/usr/local
fi

export CPPFLAGS="-I${brew_prefix}/include ${CPPFLAGS:-}"
export LDFLAGS="-L${brew_prefix}/lib ${LDFLAGS:-}"
export PKG_CONFIG_PATH="${brew_prefix}/lib/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
export DYLD_LIBRARY_PATH="${brew_prefix}/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}"
}

build_yices() {
rm -rf "${YICES_PREFIX}"
mkdir -p "${YICES_PREFIX}"
pushd "${YICES_SRC}" >/dev/null
autoconf
./configure --prefix="${YICES_PREFIX}" --enable-thread-safety --disable-mcsat
make MODE=release
make MODE=release install
popd >/dev/null
}

run_java_ci() {
export CPPFLAGS="-I${YICES_PREFIX}/include ${CPPFLAGS:-}"
export LDFLAGS="-L${YICES_PREFIX}/lib ${LDFLAGS:-}"

if [[ "$(uname)" == "Darwin" ]]; then
export DYLD_LIBRARY_PATH="${YICES_PREFIX}/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}"
else
export LD_LIBRARY_PATH="${YICES_PREFIX}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
fi

export YICES_JNI="${REPO_ROOT}/dist/lib"
export YICES_CLASSPATH="${REPO_ROOT}/build/classes"

pushd "${REPO_ROOT}" >/dev/null
ant clean test
popd >/dev/null
}

configure_brew_env
build_yices
run_java_ci
Loading
Loading