Copy of CI from master to 2020
[alexxy/gromacs.git] / admin / ci-scripts / build-and-test-sample_restraint-2020.sh
1 #!/usr/bin/env bash
2 #
3 # Build and test the sample_restraint package distributed with GROMACS 2020.
4 #
5 # This script is intended to support automated GROMACS testing infrastructure,
6 # and may be removed without notice.
7 #
8 # WARNING: This script assumes OpenMPI mpiexec. Syntax for launch wrappers from
9 # other implementations will need different syntax, and we should get a
10 # MPIRUNNER from the environment, or something.
11
12 # Make sure the script errors if any commands error.
13 set -ev
14
15 source $VENVPATH/bin/activate
16
17 # TODO: We should be able to just use a $GMXAPI_0_1_SDIST or venv artifact...
18 pushd python_packaging/src
19   GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
20     python -m pip install \
21         --no-cache-dir \
22         --no-deps \
23         --no-index \
24         --no-build-isolation \
25         .
26 popd
27
28 . $INSTALL_DIR/bin/GMXRC
29 pushd python_packaging/sample_restraint
30   mkdir build
31   pushd build
32     # TODO: Update with respect to https://redmine.gromacs.org/issues/3133
33     cmake .. \
34              -DDOWNLOAD_GOOGLETEST=ON \
35              -DGMXAPI_EXTENSION_DOWNLOAD_PYBIND=ON
36     make
37
38     make test
39     #TODO: Can we get ctest JUnitXML output here?
40
41     make install
42   popd
43
44   python -m pytest $PWD/tests --junitxml=$PLUGIN_TEST_XML
45 # TODO: enable MPI tests
46 #  if [ -x `which mpiexec` ]; then
47 #      PYTHONDONTWRITEBYTECODE=1 \
48 #      mpiexec --allow-run-as-root \
49 #        --mca opal_warn_on_missing_libcuda 0 \
50 #        --mca orte_base_help_aggregate 0 \
51 #        -n 2 \
52 #        `which python` -m pytest \
53 #          -p no:cacheprovider \
54 #          $PWD/tests \
55 #          --junitxml=$PLUGIN_MPI_TEST_XML
56 #  fi
57 popd