Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Use github-setup-solvers from bash-helpers #942

Closed
wants to merge 1 commit into from
Closed
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
77 changes: 0 additions & 77 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,72 +52,6 @@ setup_dist_bins() {
strip dist/bin/jss* || echo "Strip failed: Ignoring harmless error"
}

install_z3() {
is_exe "$BIN" "z3" && return

case "$RUNNER_OS" in
Linux) file="ubuntu-16.04.zip" ;;
macOS) file="osx-10.14.6.zip" ;;
Windows) file="win.zip" ;;
esac
curl -o z3.zip -sL "https://github.com/Z3Prover/z3/releases/download/z3-$Z3_VERSION/z3-$Z3_VERSION-x64-$file"

if $IS_WIN; then 7z x -bd z3.zip; else unzip z3.zip; fi
cp z3-*/bin/z3$EXT $BIN/z3$EXT
$IS_WIN || chmod +x $BIN/z3
rm z3.zip
}

install_cvc4() {
is_exe "$BIN" "cvc4" && return
version="${CVC4_VERSION#4.}" # 4.y.z -> y.z

case "$RUNNER_OS" in
Linux) file="x86_64-linux-opt" ;;
Windows) file="win64-opt.exe" ;;
macOS) file="macos-opt" ;;
esac
# Temporary workaround
if [[ "$RUNNER_OS" == "Linux" ]]; then
curl -o cvc4$EXT -sL "https://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/unstable/cvc4-2020-08-18-x86_64-linux-opt"
else
curl -o cvc4$EXT -sL "https://github.com/CVC4/CVC4/releases/download/$version/cvc4-$version-$file"
fi
$IS_WIN || chmod +x cvc4$EXT
mv cvc4$EXT "$BIN/cvc4$EXT"
}

install_yices() {
is_exe "$BIN" "yices" && return
ext=".tar.gz"
case "$RUNNER_OS" in
Linux) file="pc-linux-gnu-static-gmp.tar.gz" ;;
macOS) file="apple-darwin18.7.0-static-gmp.tar.gz" ;;
Windows) file="pc-mingw32-static-gmp.zip" && ext=".zip" ;;
esac
curl -o "yices$ext" -sL "https://yices.csl.sri.com/releases/$YICES_VERSION/yices-$YICES_VERSION-x86_64-$file"

if $IS_WIN; then
7z x -bd "yices$ext"
mv "yices-$YICES_VERSION"/bin/*.exe "$BIN"
else
tar -xzf "yices$ext"
pushd "yices-$YICES_VERSION" || exit
sudo ./install-yices
popd || exit
fi
rm -rf "yices$ext" "yices-$YICES_VERSION"
}

install_yasm() {
is_exe "$BIN" "yasm" && return
case "$RUNNER_OS" in
Linux) sudo apt-get update -q && sudo apt-get install -y yasm ;;
macOS) brew install yasm ;;
Windows) choco install yasm ;;
esac
}

build() {
ghc_ver="$(ghc --numeric-version)"
cp cabal.GHC-"$ghc_ver".config cabal.project.freeze
Expand Down Expand Up @@ -155,17 +89,6 @@ build_abc() {
popd
}

install_system_deps() {
install_z3 &
install_cvc4 &
install_yices &
install_yasm &
wait
export PATH=$PWD/$BIN:$PATH
echo "$PWD/$BIN" >> "$GITHUB_PATH"
is_exe "$BIN" z3 && is_exe "$BIN" cvc4 && is_exe "$BIN" yices && is_exe "$BIN" yasm
}

test_dist() {
find_java
pushd intTests
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,25 @@ jobs:
run: .github/ci.sh build
continue-on-error: false

# Temporary workaround to use latest unstable version of CVC4 on Linux
- name: Determine version of CVC4 to use
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
cvc4_dir=$(mktemp -d)
curl -o "$cvc4_dir/cvc4" -sL "https://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/unstable/cvc4-2020-10-26-x86_64-linux-opt"
echo "$cvc4_dir" >> "$GITHUB_PATH"
else
echo "CVC4_VERSION=1.8" >> "$GITHUB_ENV"
fi

- uses: LisannaAtGalois/bash-helpers@master
- shell: bash
run: .github/ci.sh install_system_deps
run: $BASH_HELPERS github-setup-solvers
env:
Z3_VERSION: "4.8.8"
CVC4_VERSION: "4.1.8"
YICES_VERSION: "2.6.2"
YASM_VERSION: "pkgmgr-latest"

- shell: bash
run: .github/ci.sh setup_dist_bins
Expand Down