From 14b308aec38c09e28366f643e034b84fef227801 Mon Sep 17 00:00:00 2001 From: Masahiro Sakai Date: Sun, 24 Jan 2021 00:29:53 +0900 Subject: [PATCH] GitHub Actions: run SCPI test using Dockerized SCIP See http://www.pokutta.com/blog/pages/scip/scip-teaching.html for detail of Dockerized SCIP. --- .github/workflows/build.yaml | 9 ++++++++- misc/scip_docker_wrapper/scip | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 misc/scip_docker_wrapper/scip diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c6f6c5e..5c73378 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,8 +14,9 @@ jobs: stack_yaml: 'stack-ghc-8.8.yaml' stack_args: '--coverage --haddock --no-haddock-deps' stack_test_args: '' - flags: '--flag MIP:TestCBC --flag MIP:TestGlpsol --flag MIP:TestLPSolve --flag MIP:TestGurobiCl' + flags: '--flag MIP:TestCBC --flag MIP:TestGlpsol --flag MIP:TestLPSolve --flag MIP:TestGurobiCl --flag MIP:TestSCIP' coveralls: true + scip_docker: true - ghc: '8.8.4' os: ubuntu-latest stack_yaml: 'stack-ghc-8.8.yaml' @@ -122,6 +123,12 @@ jobs: shell: bash run: stack exec ${{ matrix.stack_args }} -- pacman -S --needed --noconfirm ${{ matrix.MINGW_PACKAGE_PREFIX }}-glpk ${{ matrix.MINGW_PACKAGE_PREFIX }}-lpsolve + - name: Setup SCIP Docker image + if: matrix.scip_docker + run: | + docker image pull scipoptsuite/scipoptsuite:7.0.2 + echo "${GITHUB_WORKSPACE}/misc/scip_docker_wrapper" >> $GITHUB_PATH + - uses: actions/cache@v1 name: Cache ~/.stack with: diff --git a/misc/scip_docker_wrapper/scip b/misc/scip_docker_wrapper/scip new file mode 100755 index 0000000..16c7117 --- /dev/null +++ b/misc/scip_docker_wrapper/scip @@ -0,0 +1,4 @@ +#!/bin/bash + +CanonicalTemporaryDirectory=`ghc -package temporary -e "import System.IO.Temp" -e "getCanonicalTemporaryDirectory >>= putStrLn"` +docker run -v $CanonicalTemporaryDirectory:$CanonicalTemporaryDirectory -u `id -u` --entrypoint=scip scipoptsuite/scipoptsuite:7.0.2 "$@"