forked from lanl/branson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
82 lines (74 loc) · 3.25 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
#------------------------------------------------------------------------------#
# File: .travis.yml
# Author: Kelly Thompson <[email protected]>
# Date: Friday, Jul 13, 2018, 07:41 am
# Purpose: Instructions for Travis continuous integration testing on GitHub.
# This script wil be run to test pull requests
# Note: Copyright (C) 2018 Los Alamos National Security, LLC.
# All rights reserved.
#------------------------------------------------------------------------------#
language: cpp
sudo: required
services:
- docker
#------------------------------------------------------------------------------#
# Notes: Build docker container before running this script:
#
# 1. cd to directory contataining Dockerfile.
# 2. Build the docker container. This can take an hour or more. If you are
# starting from scratch, you will need to change the first line of the
# Dockerfile so that it starts from 'ubuntu' instead of 'draco-travis-ci'
#
# docker build --rm --pull --tag draco-travis-ci:latest .
#
# 3. Commit and upload the updated container:
#
# docker ps -a # find new container name
# docker commit -m "updated cmake version" -a <dockerhub moniker> \
# <container_name> kinetictheory/draco-travis-ci:latest
# docker login -u kinetictheory # must provide password to upload
# docker push
#
# 4. Optional: test the container with an interactive run (the -l is important!)
#
# docker run -it kinetictheory/draco-travis-ci /bin/bash -l
#
# or possibly
#
# docker run -it -v /path/to/draco:/home/travis/draco -w /home/travis/draco kinetictheory/draco-travis-ci /bin/bash -l -c "./.travis-run-tests.sh"
#
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# Travis Environment:
#
# HOME=/home/travis
# PWD=/home/travis/build/lanl/branson
# (starting directory for Travis, sources are here)
#
# Docker Environment:
#
# - The docker image mounts the PR sources (/home/travis/build/lanl/branson) as
# /home/travis/branson
# - The vendors are at /vendors/spack
# - Spack is already in the environment
#------------------------------------------------------------------------------#
env:
global:
- BUILD_DIR=/home/travis/branson/build
- SOURCE_DIR=/home/travis/branson
- T_SOURCE_DIR=/home/travis/build/lanl/branson
- VENDOR_DIR=/vendors
matrix:
- STYLE=ON
- WERROR=ON COVERAGE=ON DEBUG=ON
- DEBUG=OFF
# Coverage with Docker - https://docs.codecov.io/docs/testing-with-docker
install:
- travis_retry timeout 540 docker pull kinetictheory/draco-travis-ci
script:
- if [[ $COVERAGE ]]; then ci_env=`/bin/bash <(curl -s https://codecov.io/env)`; fi
- docker run ${ci_env} -v ${T_SOURCE_DIR}:${SOURCE_DIR} -e VENDOR_DIR=${VENDOR_DIR} -e BUILD_DIR=${BUILD_DIR} -e SOURCE_DIR=${SOURCE_DIR} -e STYLE=${STYLE} -e TRAVIS=${TRAVIS} -e COVERAGE=${COVERAGE} -e WERROR=${WERROR} -e DEBUG=${DEBUG} kinetictheory/draco-travis-ci /bin/bash -l -c "${SOURCE_DIR}/scripts/travis-run-tests.sh"
#------------------------------------------------------------------------------#
# See also:
# - Advanced used: https://github.com/laristra/flecsi/blob/master/.travis.yml
#------------------------------------------------------------------------------#