-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github action to run unit tests (#349)
* Add github workflow to run unit tests: - For python 3.5, 3.6, 3.7, and 3.8 pull the appropriate cmbenv:toast-deps container. - Install toast into a temporary container based on one of these upstream images. - Run the serial and MPI tests in this temporary container, and also test that the documentation builds with sphinx. This also removes the entire directory of travis support scripts, which are no longer needed. An additional workflow can be added later for deploying to pip wheels. * Use package version for sphinx build
- Loading branch information
Showing
12 changed files
with
121 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Use pre-built docker containers to run our unit tests on different python versions. | ||
|
||
name: Run Test Suite | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
py35: | ||
name: Python 3.5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Pull Dependency Image | ||
run: docker pull hpc4cmb/toast-deps-py35:latest | ||
- name: Compile | ||
run: docker run -v "$(pwd)":/home/toast --name="test_py35" hpc4cmb/toast-deps-py35:latest /home/toast/platforms/install_test_runner.sh && docker commit -m "test runner" test_py35 test_runner:py35 | ||
- name: Test Documentation Build | ||
run: docker run -v "$(pwd)":/home/toast test_runner:py35 /home/toast/docs/build_docs.sh | ||
- name: Run Serial Tests | ||
run: docker run test_runner:py35 python -c 'import toast.tests; toast.tests.run()' | ||
- name: Run MPI Tests | ||
run: docker run test_runner:py35 mpirun -np 2 python -c 'import toast.tests; toast.tests.run()' | ||
py36: | ||
name: Python 3.6 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Pull Dependency Image | ||
run: docker pull hpc4cmb/toast-deps-py36:latest | ||
- name: Compile | ||
run: docker run -v "$(pwd)":/home/toast --name="test_py36" hpc4cmb/toast-deps-py36:latest /home/toast/platforms/install_test_runner.sh && docker commit -m "test runner" test_py36 test_runner:py36 | ||
- name: Test Documentation Build | ||
run: docker run -v "$(pwd)":/home/toast test_runner:py36 /home/toast/docs/build_docs.sh | ||
- name: Run Serial Tests | ||
run: docker run test_runner:py36 python -c 'import toast.tests; toast.tests.run()' | ||
- name: Run MPI Tests | ||
run: docker run test_runner:py36 mpirun -np 2 python -c 'import toast.tests; toast.tests.run()' | ||
py37: | ||
name: Python 3.7 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Pull Dependency Image | ||
run: docker pull hpc4cmb/toast-deps-py37:latest | ||
- name: Compile | ||
run: docker run -v "$(pwd)":/home/toast --name="test_py37" hpc4cmb/toast-deps-py37:latest /home/toast/platforms/install_test_runner.sh && docker commit -m "test runner" test_py37 test_runner:py37 | ||
- name: Test Documentation Build | ||
run: docker run -v "$(pwd)":/home/toast test_runner:py37 /home/toast/docs/build_docs.sh | ||
- name: Run Serial Tests | ||
run: docker run test_runner:py37 python -c 'import toast.tests; toast.tests.run()' | ||
- name: Run MPI Tests | ||
run: docker run test_runner:py37 mpirun -np 2 python -c 'import toast.tests; toast.tests.run()' | ||
py38: | ||
name: Python 3.8 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Pull Dependency Image | ||
run: docker pull hpc4cmb/toast-deps-py38:latest | ||
- name: Compile | ||
run: docker run -v "$(pwd)":/home/toast --name="test_py38" hpc4cmb/toast-deps-py38:latest /home/toast/platforms/install_test_runner.sh && docker commit -m "test runner" test_py38 test_runner:py38 | ||
- name: Test Documentation Build | ||
run: docker run -v "$(pwd)":/home/toast test_runner:py38 /home/toast/docs/build_docs.sh | ||
- name: Run Serial Tests | ||
run: docker run test_runner:py38 python -c 'import toast.tests; toast.tests.run()' | ||
- name: Run MPI Tests | ||
run: docker run test_runner:py38 mpirun -np 2 python -c 'import toast.tests; toast.tests.run()' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Copy the docs directory to the local working directory and build it with sphinx | ||
|
||
set -e | ||
|
||
# Get the absolute path to the docs folder | ||
pushd $(dirname $0) > /dev/null | ||
docdir=$(pwd -P) | ||
popd > /dev/null | ||
|
||
cp -a "${docdir}" ./docs | ||
pushd ./docs > /dev/null | ||
make html | ||
popd > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# This script is for a complete build and install to /usr/local inside a | ||
# docker container. It is used when running CI unit tests. | ||
|
||
set -e | ||
|
||
# Get the absolute path to the source tree | ||
pushd $(dirname $(dirname $0)) > /dev/null | ||
toastdir=$(pwd -P) | ||
popd > /dev/null | ||
|
||
mkdir build | ||
pushd build | ||
|
||
cmake \ | ||
-DCMAKE_C_COMPILER="gcc" \ | ||
-DCMAKE_CXX_COMPILER="g++" \ | ||
-DMPI_C_COMPILER="mpicc" \ | ||
-DMPI_CXX_COMPILER="mpicxx" \ | ||
-DCMAKE_C_FLAGS="-O3 -g -fPIC -pthread" \ | ||
-DCMAKE_CXX_FLAGS="-O3 -g -fPIC -pthread -std=c++11" \ | ||
-DPYTHON_EXECUTABLE:FILEPATH=$(which python3) \ | ||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local \ | ||
"${toastdir}" | ||
|
||
make -j 2 install | ||
|
||
popd > /dev/null |
Oops, something went wrong.