forked from mdolab/dafoam
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis_backup.yml
executable file
·125 lines (112 loc) · 9.8 KB
/
.travis_backup.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
os: linux
dist: bionic
language: generic
services:
- docker
env:
global:
- REPO_NAME=dafoam
- DOCKER_WORKING_DIR=/home/dafoamuser/$REPO_NAME
- DOCKER_MOUNT_DIR=/home/dafoamuser/mount/$REPO_NAME
- DOCKER_TAG=latest
notifications:
webhooks: https://coveralls.io/webhook
before_install:
- docker pull dafoam/opt-packages:$DOCKER_TAG
# run Docker, key is we mount the current Travis directory into Docker to access content of repo
- docker run -it -d -u dafoamuser --name regtest
--mount "type=bind,src=$(pwd),target=$DOCKER_MOUNT_DIR"
dafoam/opt-packages:$DOCKER_TAG
/bin/bash
install:
# We thrown away the existing repo in Docker, and copy the new one in-place
- docker exec -it regtest /bin/bash -c "rm -rf $DOCKER_WORKING_DIR && cp -r $DOCKER_MOUNT_DIR $DOCKER_WORKING_DIR"
# Add flags for code coverage and compile
- docker exec regtest sed -i 's/-std=c++11/-std=c++11 -coverage/g' $DOCKER_WORKING_DIR/src/adjoint/Make/options_Incompressible
- docker exec regtest sed -i 's/-lOpenFOAM/-lOpenFOAM -lgcov/g' $DOCKER_WORKING_DIR/src/adjoint/Make/options_Incompressible
- docker exec regtest sed -i 's/-std=c++11/-std=c++11 -coverage/g' $DOCKER_WORKING_DIR/src/adjoint/Make/options_Compressible
- docker exec regtest sed -i 's/-lOpenFOAM/-lOpenFOAM -lgcov/g' $DOCKER_WORKING_DIR/src/adjoint/Make/options_Compressible
# untar the input.tar.gz for tests
- docker exec -it regtest /bin/bash -c "cd $DOCKER_WORKING_DIR/tests && rm -rf input.tar.gz && wget https://github.com/dafoam/files/releases/download/v1.0.0/input.tar.gz && tar -xzf input.tar.gz"
jobs:
include:
- stage: runTests # run the incompressible tests
script:
# compile all components
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && ./Allmake incompressible"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoamAD.sh && cd $DOCKER_WORKING_DIR && ./Allclean && ./Allmake incompressible 2> makeWarnings.txt"
- docker exec -it regtest /bin/bash -c "cp /home/dafoamuser/OpenFOAM/-v1812-AD/platforms/linux64GccDPInt32Opt/lib/*.so /home/dafoamuser/OpenFOAM/-v1812/platforms/linux64GccDPInt32Opt/lib/"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && pip install ."
# just run the tests
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && ./Allrun incompressible"
- stage: runTests # run the compressible tests
script:
# compile all components
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && ./Allmake compressible && pip install ."
# just run the tests
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && ./Allrun compressible"
- stage: runTests # run the solid tests
script:
# compile all components
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && ./Allmake solid && pip install ."
# just run the tests
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && ./Allrun solid"
- stage: runTests # coverage for incompressible
script:
# compile incompressible solvers
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && ./Allmake incompressible && pip install ."
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoamAD.sh && cd $DOCKER_WORKING_DIR && ./Allmake incompressible 2> makeWarnings.txt"
- docker exec -it regtest /bin/bash -c "cp /home/dafoamuser/OpenFOAM/-v1812-AD/platforms/linux64GccDPInt32Opt/lib/*.so /home/dafoamuser/OpenFOAM/-v1812/platforms/linux64GccDPInt32Opt/lib/"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && pip install ."
# install cpp-coveralls and coverage
- docker exec -it regtest /bin/bash -c "pip install cpp-coveralls --user && pip install coverage --user"
# compile and run the tests
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DASimpleFoam.py"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DASimpleFoamMRF.py"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DASimpleTFoam.py"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DAPisoFoam.py"
- docker exec -it regtest /bin/bash -c "cd $DOCKER_WORKING_DIR/tests && rm -rf input && tar -xzf input.tar.gz"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DAPisoFoamACTL.py"
# run coveralls, the -lp option is for inline functions in C++
- docker exec -it -e TRAVIS="$TRAVIS" -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/src/adjoint && cp -r ../include ./Make/linux*/DASolver/ && cp -r ../include ./Make/linux*/ && COVERALLS_PARALLEL=true coveralls --gcov-options '\-lp'"
- stage: runTests # coverage for compressible
script:
# compile incompressible solvers
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && ./Allmake compressible && pip install ."
# install cpp-coveralls and coverage
- docker exec -it regtest /bin/bash -c "pip install cpp-coveralls --user && pip install coverage --user"
# compile and run the tests
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DARhoSimpleFoam.py"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DARhoSimpleFoamMRF.py"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DARhoSimpleFoamUBend.py"
- docker exec -it regtest /bin/bash -c "cd $DOCKER_WORKING_DIR/tests && rm -rf input && tar -xzf input.tar.gz"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DARhoSimpleCFoam.py"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DATurboFoamSubsonic.py"
- docker exec -it regtest /bin/bash -c "cd $DOCKER_WORKING_DIR/tests && rm -rf input && tar -xzf input.tar.gz"
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DATurboFoamTransonic.py"
# run coveralls, the -lp option is for inline functions in C++
- docker exec -it -e TRAVIS="$TRAVIS" -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/src/adjoint && cp -r ../include ./Make/linux*/DASolver/ && cp -r ../include ./Make/linux*/ && COVERALLS_PARALLEL=true coveralls --gcov-options '\-lp'"
- stage: runTests # coverage for solid
script:
# compile solid solvers
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && ./Allmake solid && pip install ."
# install cpp-coveralls and coverage
- docker exec -it regtest /bin/bash -c "pip install cpp-coveralls --user && pip install coverage --user"
# compile and run the tests
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 python runTests_DASolidDisplacementFoam.py"
# run coveralls, the -lp option is for inline functions in C++
- docker exec -it -e TRAVIS="$TRAVIS" -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/src/adjoint && cp -r ../include ./Make/linux*/DASolver/ && cp -r ../include ./Make/linux*/ && COVERALLS_PARALLEL=true coveralls --gcov-options '\-lp'"
- stage: runTests # coverage for the python layer
script:
# compile incompressible solvers
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR && ./Allmake incompressible && pip install ."
# install coveralls and coverage
- docker exec -it regtest /bin/bash -c "pip install coveralls --user && pip install coverage --user"
# serial test
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && coverage run --include=$DOCKER_PIP_INSTALL_PATH/dafoam/pyDAFoam.py runTests_Integration.py"
# parallel test
- docker exec -it regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && mpirun -np 4 coverage run --include=$DOCKER_PIP_INSTALL_PATH/dafoam/pyDAFoam.py runTests_Integration.py"
# combine and run coveralls
- docker exec -it -e TRAVIS="$TRAVIS" -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" regtest /bin/bash -c ". /home/dafoamuser/setupDAFoam.sh && cd $DOCKER_WORKING_DIR/tests && coverage combine && COVERALLS_PARALLEL=true coveralls"
after_script:
- docker rm -f regtest