-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.travis.yml
More file actions
80 lines (68 loc) · 2.48 KB
/
.travis.yml
File metadata and controls
80 lines (68 loc) · 2.48 KB
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
dist: bionic
sudo: required
env:
global:
- DOCKER_REPO=nsfcareer/femtech
# Should use znver2 after updating gcc/ubuntu
- EC2ARCH=znver1
language:
- cpp
services:
- docker
compiler:
- gcc
addons:
apt:
packages:
- cmake
- libblas-dev
- liblapack-dev
- openmpi-bin
- openmpi-common
- libopenmpi-dev
- python-numpy
before_install:
# Check versions of gcc, g++ and cmake
- gcc -v && g++ -v && cmake --version
# Check instruction set used during travis build
- gcc -### -E - -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )|( -mno-[^\ ]+)//g'
- python --version
before_script:
# Run your build commands next
- mkdir build
- cd build/
- cmake .. -DEXAMPLES=ON -DEXAMPLE9=ON -DEXAMPLE1=ON -DEXAMPLE10=ON -DEXAMPLE5=ON
- if [ "$TRAVIS_BRANCH" = "develop" ] || [ "$TRAVIS_BRANCH" = "CI" ]; then
docker pull $DOCKER_REPO:production || true;
docker pull $DOCKER_REPO:develop || true;
fi
script:
- pwd
- make -j 4
# test example 9
- cd ./examples/ex9/
- mpirun -n 1 --mca btl_base_warn_component_unused 0 ex9 1-elt-cube.k
- python compareResults.py
# test example 1
- cd ../ex1
- mpirun -n 2 --mca btl_base_warn_component_unused 0 ex1 mixed-hex-tet.k
# test example 10
- cd ../ex10
- mpirun -n 1 --mca btl_base_warn_component_unused 0 ex10 1-elt-tet.k
# Build docker image if on develop branch
- if [ "$TRAVIS_BRANCH" = "develop" ] || [ "$TRAVIS_BRANCH" = "CI" ]; then
cd ../../..;
mkdir builddocker;
docker build --build-arg BRANCH=$TRAVIS_BRANCH --build-arg PARCH=$EC2ARCH --pull --cache-from $DOCKER_REPO:develop --target buildFemTech --tag $DOCKER_REPO:develop -f Dockerfile builddocker || travis_terminate 1;
docker run --name testFemTech -it --rm $DOCKER_REPO:develop /bin/bash -c "cd /home/ubuntu/FemTech/build_native/examples/ex5/;bash test_ex5.sh" || travis_terminate 1;
docker build --build-arg BRANCH=$TRAVIS_BRANCH --build-arg PARCH=$EC2ARCH --pull --cache-from $DOCKER_REPO:develop --cache-from $DOCKER_REPO:production --tag $DOCKER_REPO:production -f Dockerfile builddocker;
fi
after_script:
- if [ "$TRAVIS_BRANCH" = "develop" ] || [ "$TRAVIS_BRANCH" = "CI" ]; then docker images; fi
before_deploy:
- if [ "$TRAVIS_BRANCH" = "develop" ]; then docker login -u "$CONTAINER_USER" -p "$CONTAINER_PASS"; fi
deploy:
provider: script
script: docker push $DOCKER_REPO:production && docker push $DOCKER_REPO:develop
on:
branch: develop