diff --git a/.github/ci.sh b/.github/ci.sh index 71d46a181f..683d0bd423 100755 --- a/.github/ci.sh +++ b/.github/ci.sh @@ -118,6 +118,9 @@ zip_dist() { zip_dist_with_solvers() { sname="${1}" + # Because these binaries come from the what4-solvers repository, they + # should be at least as portable (in terms of dynamic library + # dependencies) as the SAW binaries. cp "$BIN/abc" dist/bin/ cp "$BIN/cvc4" dist/bin/ cp "$BIN/yices" dist/bin/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b67c9b4c1..88198aeaab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,10 @@ +# Overall configuration notes: +# - Artifact uploads for binaries are from GHC 8.10.3 +# - Builds for Ubuntu happen on 18.04 (would like to include 20.04, in addition) +# - Builds for macOS builds on 10.15 (to avoid GHC bug on macOS 11; solvable with GHC > 8.10.4) +# - Docker builds happen nightly, on manual invocation, and on release branch commits +# Please update this comment as those details change. + name: SAWScript on: push: @@ -12,9 +19,10 @@ env: CACHE_VERSION: 1 DISABLED_TESTS: "test0000 test_FNV_a1_rev test0010_jss_cnf_exp test0039_rust test_boilerplate test_external_abc" - # Solver versions - also update in the following locations: + # Solver package snapshot date - also update in the following locations: # ./saw/Dockerfile # ./saw-remote-api/Dockerfile + # ./s2nTests/scripts/blst-entrypoint.sh # ./s2nTests/docker/saw.dockerfile SOLVER_PKG_VERSION: "snapshot-20210917" diff --git a/saw-remote-api/scripts/test_docker.sh b/saw-remote-api/scripts/test_docker.sh index 131cca7e1a..5610d6fe5e 100755 --- a/saw-remote-api/scripts/test_docker.sh +++ b/saw-remote-api/scripts/test_docker.sh @@ -2,57 +2,55 @@ echo "Testing saw-remote-api docker image..." -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" - -TAG=${1:-saw-remote-api} +cleanup () { + echo "killing saw-remote-api docker container" + docker container kill saw-remote-api || true + docker container rm saw-remote-api || true +} +trap cleanup EXIT -pushd $DIR/.. +DIR="$( dirname "$( dirname "${BASH_SOURCE[0]}" )")" -docker run --name=saw-remote-api -d \ - --env CLASSPATH=/home/saw/tests/saw/test-files \ - -v $PWD/python/tests/saw/test-files:/home/saw/tests/saw/test-files \ - -p 8080:8080 \ - "$TAG" +TAG=${1:-saw-remote-api} -if (( $? != 0 )); then - echo "Failed to launch docker container" - exit 1 -fi +( cd "$DIR"; + docker run --name=saw-remote-api -d \ + --env CLASSPATH=/home/saw/tests/saw/test-files \ + -v $PWD/python/tests/saw/test-files:/home/saw/tests/saw/test-files \ + -p 8080:8080 \ + "$TAG"; -popd + if (( $? != 0 )); then + echo "Failed to launch docker container" + exit 1 + fi +) sleep 5 # let the server catch its breath and be ready for requests -pushd $DIR/../python +( cd "$DIR/python"; -NUM_FAILS=0 -function run_test { + NUM_FAILS=0; + function run_test { "$@" if (( $? != 0 )); then NUM_FAILS=$(($NUM_FAILS+1)); fi -} - - -echo "Setting up python environment for remote server clients..." -poetry update -poetry install - -export SAW_SERVER_URL="http://localhost:8080/" -run_test poetry run python -m unittest discover tests/saw -run_test poetry run python -m unittest discover tests/saw_low_level - -popd - -echo "killing saw-remote-api docker container" - -docker container kill saw-remote-api -docker container rm saw-remote-api - - -if [ $NUM_FAILS -eq 0 ] -then - echo "All docker saw-remote-api tests passed" - exit 0 -else - echo "Some docker saw-remote-api tests failed" - exit 1 -fi + }; + + + echo "Setting up python environment for remote server clients..."; + poetry update; + poetry install; + + export SAW_SERVER_URL="http://localhost:8080/"; + run_test poetry run python -m unittest discover tests/saw; + run_test poetry run python -m unittest discover tests/saw_low_level; + + if [ $NUM_FAILS -eq 0 ] + then + echo "All docker saw-remote-api tests passed" + exit 0 + else + echo "Some docker saw-remote-api tests failed" + exit 1 + fi +)