-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.travis.yml
139 lines (130 loc) · 5.07 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
language: bash
jobs:
include:
# Stages for all branches and pull requests
- stage: Build and run unit tests
name: Build on Linux environment
os: linux
dist: bionic
before_install:
- sudo apt-get update
- curl -OJLs https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
- bash Miniconda3-latest-Linux-x86_64.sh -p $HOME/miniconda -b
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda config --set always_yes yes
- cd ${TRAVIS_BUILD_DIR}
- conda env create -f environment.yml
- conda activate lm3_dev
script:
- cd ${TRAVIS_BUILD_DIR}
- cmake -H. -B_build -D CMAKE_BUILD_TYPE=Release -D LM_BUILD_GUI_EXAMPLES=OFF
- cmake --build _build -- -j2
- |
cat > .lmenv << EOF
{
"path": "${TRAVIS_BUILD_DIR}",
"bin_path": "${TRAVIS_BUILD_DIR}/_build/bin"
}
EOF
- cat .lmenv
- python run_tests.py --lmenv .lmenv
- name: Build on Windows environment
os: windows
dist: 1803-containers
# Workaround for https://travis-ci.community/t/choco-install-hangs-forever/307/20
filter_secrets: false
before_install:
- choco install miniconda3
- export PATH="/c/Tools/miniconda3:/c/Tools/miniconda3/Library/bin:/c/Tools/miniconda3/Scripts:$PATH"
- conda config --set always_yes yes
- cd ${TRAVIS_BUILD_DIR}
- conda env create -f environment.yml
- source activate lm3_dev
script:
- cd ${TRAVIS_BUILD_DIR}
- cmake -G "Visual Studio 15 2017 Win64" -H. -B_build
- cmake --build _build --config Release
- |
cat > .lmenv << EOF
{
"path": "$(pwd -W)",
"bin_path": "$(pwd -W)/_build/bin/Release"
}
EOF
- cat .lmenv
- python run_tests.py --lmenv .lmenv
# ---------------------------------------------------------------------------------------------
# Stages only for push to master branch
- name: Conda build on Linux environment
if: (branch = master) AND (type = push)
os: linux
dist: bionic
before_install:
- sudo apt-get update
- curl -OJLs https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
- bash Miniconda3-latest-Linux-x86_64.sh -p $HOME/miniconda -b
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda config --set always_yes yes
- conda install conda-build anaconda-client
script:
- cd ${TRAVIS_BUILD_DIR}/conda
- conda build -c hi2p-perim -c conda-forge .
- export CONDA_BLD_OUTPUT=`conda build -c hi2p-perim -c conda-forge . --output`
# cf. https://stackoverflow.com/questions/59904826/anaconda-client-cli-installed-but-anaconda-command-not-found
- conda activate base
- anaconda -t $CONDA_UPLOAD_TOKEN upload -u hi2p-perim $CONDA_BLD_OUTPUT --force
- name: Conda build on Windows environment
if: (branch = master) AND (type = push)
os: windows
dist: 1803-containers
before_install:
- choco install miniconda3
- export PATH="/c/Tools/miniconda3:/c/Tools/miniconda3/Library/bin:/c/Tools/miniconda3/Scripts:$PATH"
- conda config --set always_yes yes
- conda install conda-build anaconda-client
script:
- cd ${TRAVIS_BUILD_DIR}/conda
- conda build -c hi2p-perim -c conda-forge .
- export CONDA_BLD_OUTPUT=`conda build -c hi2p-perim -c conda-forge . --output`
- anaconda -t $CONDA_UPLOAD_TOKEN upload -u hi2p-perim $CONDA_BLD_OUTPUT --force
# Build docker container
- stage: Docker build
if: (branch = master) AND (type = push)
os: linux
sudo: required
services: docker
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t lightmetrica-v3-travis .
- docker images
- docker tag lightmetrica-v3-travis $DOCKER_USERNAME/lightmetrica-v3-travis
- docker push $DOCKER_USERNAME/lightmetrica-v3-travis
# We separated a job for tests to meet the limit of maximum running time
- stage: Functional tests and documentation
if: (branch = master) AND (type = push)
os: linux
sudo: required
services: docker
before_install:
- git clone https://[email protected]/hi2p-perim/lightmetrica-v3-scenes-2.git scenes
script:
- travis_wait 120 sleep infinity & docker run --rm -it -v $TRAVIS_BUILD_DIR:/lm3 $DOCKER_USERNAME/lightmetrica-v3-travis bash -c \
'source ~/.bashrc &&
cd /lightmetrica-v3 &&
python run_tests.py --lmenv .lmenv_docker --functest &&
cp -r executed_functest /lm3/doc/ &&
cd /lm3/doc &&
mkdir _build &&
doxygen &&
make html &&
touch _build/html/.nojekyll'
deploy:
provider: pages
repo: lightmetrica/lightmetrica-v3-doc
local_dir: doc/_build/html
skip_cleanup: true
github_token: $GITHUB_TOKEN
keep_history: false
target-branch: master
on:
branch: master