From 471dadcd13e6d9267d3e69dac394ee008ca3fe8b Mon Sep 17 00:00:00 2001 From: Lisanna Dettwyler Date: Mon, 30 Nov 2020 17:10:35 -0800 Subject: [PATCH] Use github-setup-solvers from bash-helpers --- .github/ci.sh | 77 ------------------------------------- .github/workflows/build.yml | 17 +++++++- 2 files changed, 15 insertions(+), 79 deletions(-) diff --git a/.github/ci.sh b/.github/ci.sh index ca4b4ffd0b..9b1c39e49f 100755 --- a/.github/ci.sh +++ b/.github/ci.sh @@ -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 @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2130eeb631..bc8393278e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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