-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
52 lines (44 loc) · 2.42 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
language: cpp
sudo: required
services:
- docker
env:
matrix:
- DISTRO=fedora30 MPI_PACKAGE=openmpi RUNTIME=mpi BUILD_TYPE=Release DOCKERHUB=true
- DISTRO=fedora30 MPI_PACKAGE=openmpi RUNTIME=legion BUILD_TYPE=Release DOCKERHUB=true
- DISTRO=ubuntu18 MPI_PACKAGE=mpich RUNTIME=mpi BUILD_TYPE=Release DOCKERHUB=true
- DISTRO=ubuntu18 MPI_PACKAGE=mpich RUNTIME=legion BUILD_TYPE=Release DOCKERHUB=true
before_install:
- sudo fallocate -l 2G /swapfile
- sudo chmod 600 /swapfile
- sudo mkswap /swapfile
- sudo swapon /swapfile
- sudo sysctl vm.swappiness=10
- sudo sysctl -w vm.max_map_count=1966080
- git fetch --unshallow && git fetch --tags #for versioning
script:
- if [[ ${CC} != gcc ]]; then TAG="_${CC}"; fi
- if [[ ${TRAVIS_BRANCH} != master ]]; then TAG="${TAG}_${TRAVIS_BRANCH//[^a-zA-Z0-9]/_}"; fi
- cp -vr docker ${HOME}/docker
- sed -i "1s/fedora30/${DISTRO}_${MPI_PACKAGE}_${RUNTIME}${TAG}/" ${HOME}/docker/Dockerfile
- cd ../../
- mv -v ${TRAVIS_REPO_SLUG} $HOME/docker
- travis_wait 60 docker build --build-arg BUILD_TYPE=${BUILD_TYPE}
--build-arg MPI_PACKAGE=${MPI_PACKAGE}
--build-arg RUNTIME=${RUNTIME}
--build-arg CC=${CC}
--build-arg CXX=${CXX}
--build-arg CI=${CI} --build-arg TRAVIS=${TRAVIS} --build-arg TRAVIS_OS_NAME=${DISTRO}
--build-arg TRAVIS_BRANCH=${TRAVIS_BRANCH} --build-arg TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
--build-arg TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} --build-arg TRAVIS_JOB_ID=${TRAVIS_JOB_ID}
--build-arg TRAVIS_TAG=${TRAVIS_TAG} --build-arg TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG}
--build-arg TRAVIS_COMMIT=${TRAVIS_COMMIT}
-t ${TRAVIS_REPO_SLUG}:${DISTRO}_${MPI_PACKAGE}_${RUNTIME}${TAG} ${HOME}/docker/ &&
CON=$(docker run -d ${TRAVIS_REPO_SLUG}:${DISTRO}_${MPI_PACKAGE}_${RUNTIME}${TAG} /bin/bash)
after_success:
- if [[ ${DOCKERHUB} = true && ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${TRAVIS_BRANCH} == master && ${CC} = gcc ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push "${TRAVIS_REPO_SLUG}:${DISTRO}_${MPI_PACKAGE}_${RUNTIME}${TAG}";
fi
compiler:
- gcc