-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
57 lines (50 loc) · 2.5 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
# No longer used, replaced by GitHub Actions
# Keep this workflow as a reference
# It had the advantage of only pushing to Docker Hub if the test cases passed
sudo: required
services:
- docker
before_script:
# Use the DockerHub image as a cache
# https://medium.com/mobileforgood/coding-tips-patterns-for-continuous-integration-with-docker-on-travis-ci-9cedb8348a62
- docker pull agitter/singe:tmp
- docker build --pull --cache-from agitter/singe:tmp -t agitter/singe:tmp -f docker/Dockerfile .
script:
# Store the md5sums of the tracked source files before running tests in the Docker image
# The Docker image does not have git installed
- md5sum $(git ls-tree -r HEAD --name-only | grep '.*\.m$') > current_code.md5
# Run SINGE tests in the built Docker image
# The conda environment should be activated before running the bash script
# See https://github.com/conda/conda/issues/7980
- docker run -v $(pwd):/SINGE -w /SINGE --entrypoint "/bin/bash" agitter/singe:tmp -c "source ~/.bashrc; conda activate singe-test; tests/docker_test.sh"
# Proof-of-concept of running SINGE in a high-throughput style
# Can be moved to run in a parallel Travis CI job
- bash tests/high_throughput_test.sh
# Test standalone SINGE run through Docker
- bash tests/standalone_test.sh
# Test standalone SINGE on a branching dataset
- bash tests/standalone_branching_test.sh
# Confirm the hyperparameter generation script works
- cd scripts
- bash generate_hyperparameters.sh
after_script:
# Inspect the built image
- docker images
before_deploy:
# Set DOCKER_USERNAME and DOCKER_PASSWORD as environment variables at Travis CI settings page
# Allow DOCKER_USERNAME to be shown in the build log
# https://travis-ci.com/gitter-lab/SINGE/settings
# Note security risk with encrypted variables if the GitHub repository is transferred
# https://andrewwegner.com/travisci-insecure-environment-variables.html
# Use --password-stdin to keep passwords out of log files
# https://docs.docker.com/engine/reference/commandline/login/
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
deploy:
# If commit is on the master branch, push the temporary Docker image to DockerHub
# See https://docs.travis-ci.com/user/docker/#pushing-a-docker-image-to-a-registry and
# https://medium.com/mobileforgood/coding-tips-patterns-for-continuous-integration-with-docker-on-travis-ci-9cedb8348a62
provider: script
script: docker push agitter/singe:tmp
skip_cleanup: true
on:
branch: master