-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
97 lines (83 loc) · 3.53 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
language: cpp
dist: xenial
notifications:
email: false
cache:
directories:
- $TRAVIS_BUILD_DIR/openmpi-build
- $TRAVIS_BUILD_DIR/openmpi-3.1.3
matrix:
include:
- os: linux
addons:
apt:
sources:
- deadsnakes
- ubuntu-toolchain-r-test
packages:
- python3.7-dev
- g++-7
- lcov
env:
- C_COMPILER="gcc-7", CXX_COMPILER="g++-7"
env:
global:
# Doctr deploy key for bsamseth/thesis
- secure: "QurDzXDM9zvLZv56F7J2lZY0xQW5FkuWCoM2o0X+ldoh7u9Mkqu0KpCex2Byp89w+dNby6RGC4662dHBJB9iwjo5XvWNe5icDkWg83bMOCMPRu9UFHiNdgiUWR2FEGXyKG8XwdveiXxUXzHtvKeLoPINAogANxvIgl/p8y1O/c8Xt6+dnY3mtmnck9GET+MM0Irfh6QVX8jiuSDSoVKHWro231QdUNBj8pAq4aNAW8FHyIRirt7FQPCS5JxLzNMpoKqq+sjr5knhbi+Y2qzvXDs9bFB3DgMKWCKZZ46dXvfWOGS+PBcaAxT9xlonBvjTt+asp7qSCXbqhlobg4uJXTPF4ZqRAhO54EHOIpfH0S8sqWeO1BCUZQVEHMlNo1JhXqwfHMu2qfcJzusDKSR55aX8x7GhKzaBYVG5ZOhIPS/JwOdq/XK/5r7EHwtp0dbZZPet7h+7zg+uRL0SI7kXiLNX5YLRFm+blx+nom0Eq8VcwOT9b8mJ12xSJTEWrY4G+a/avVy6XdXtYfM8VGtP2hbpmMOHEo7u/brwspWVnKbNi7/jE5PcHsBrY4P6lQHBP4pkmIocgZrb4Ag551UG8AGZz/n2yttqzQlz8q/dQACiZ4vp3to3OD+2w/UfeZe9i2bA90eG+XA+JKUF6/1zrPfd34Am1RSUuBs4ce3IleA="
before_install:
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 90
# Setup Python environemnt
- pyenv global $(pyenv whence 2to3)
- pip install poetry
# Setup MPI
- export MPI_BUILD_DIR=$TRAVIS_BUILD_DIR/openmpi-build
- export MPI_VERSION="3.1"
- export MPI_FULL_VERSION="3.1.3"
- source ci/install-openmpi.sh
- $MPI_CC --version
- $MPI_CXX --version
- $MPI_EXEC --version
- poetry --version
# Setup variables for build
- export CMAKE_C_COMPILER=$C_COMPILER
- export CMAKE_CXX_COMPILER=$CXX_COMPILER
- export MPI_C_COMPILER=$MPI_CC
- export MPI_CXX_COMPILER=$MPI_CXX
- export MPI_CXX_SKIP_MPICXX=1
- export CMAKE_BUILD_TYPE=Coverage
- env MPICC=$MPI_CC poetry install --no-root
install:
# Build, being super explicit about where to find stuff!
- mkdir build-py && cd build-py
- poetry run cmake .. -DCMAKE_BUILD_TYPE=Coverage -DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DMPI_C_COMPILER=$MPI_CC -DMPI_CXX_COMPILER=$MPI_CXX -DMPI_CXX_SKIP_MPICXX=1
- poetry run make -j3
- cd -
script:
# Install package
- poetry install
# Build docs
- set -e
- cd docs
- poetry run make html
- poetry run make doctest
- find _build -type f -exec sed -i 's/_qflow_backend/qflow/' {} +
- cd ..
- poetry run pip install doctr
- poetry run doctr deploy . --built-docs docs/_build/html
# Run tests
- poetry run pytest tests
# Check that the tests can run with MPI (if Travis has more than one CPU available).
- $MPI_EXEC -n 2 build-py/unit_tests.x || $MPI_EXEC -n 1 build-py/unit_tests.x
after_success:
- lcov --capture --directory . --output-file coverage.info
- lcov --remove coverage.info '*/tests/*' '/usr/*' '*/external/*' '/Applications/*' --output-file coverage.info # filter system-files
- lcov --list coverage.info
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
# Run benchmark on release build
- export CMAKE_BUILD_TYPE=Release
- cd build-py
- poetry run cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DMPI_C_COMPILER=$MPI_CC -DMPI_CXX_COMPILER=$MPI_CXX -DMPI_CXX_SKIP_MPICXX=1
- poetry run make -j3
- cd -
- poetry install
- $MPI_EXEC -n 2 poetry run python scripts/benchmark.py || $MPI_EXEC -n 1 poetry run python scripts/benchmark.py