This repository has been archived by the owner on Mar 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
37 lines (33 loc) · 1.57 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
sudo: required
services: docker
language: generic
env:
- DOCKER_FILE="Dockerfile.debian8.py2" PYTHON="python"
- DOCKER_FILE="Dockerfile.debian8.py3" PYTHON="python3"
- DOCKER_FILE="Dockerfile.debian9.py2" PYTHON="python"
- DOCKER_FILE="Dockerfile.debian9.py3" PYTHON="python3"
- DOCKER_FILE="Dockerfile.fedora25.py2" PYTHON="python"
- DOCKER_FILE="Dockerfile.fedora25.py3" PYTHON="python3"
- DOCKER_FILE="Dockerfile.ubuntu14.04.py2" PYTHON="python"
- DOCKER_FILE="Dockerfile.ubuntu14.04.py3" PYTHON="python3"
- DOCKER_FILE="Dockerfile.ubuntu16.04.py2" PYTHON="python"
- DOCKER_FILE="Dockerfile.ubuntu16.04.py3" PYTHON="python3"
- DOCKER_FILE="Dockerfile.ubuntu16.10.py2" PYTHON="python"
- DOCKER_FILE="Dockerfile.ubuntu16.10.py3" PYTHON="python3"
before_install:
# Create a docker image called "myimage"
- docker build -t myimage -f "$DOCKER_FILE" .
before_script:
# create a docker container from the image, mount the current working
# directory to /app inside the container and let the container running
# in the background. The resulting container ID will be saved to
# container_id so we can reference it later on.
- docker run --volume "$(pwd):/app" --workdir "/app" --tty --detach myimage bash > container_id
script:
# run our tests in the running contained
- docker exec "$(cat container_id)" xvfb-run -a "$PYTHON" -m pytest test.py
- docker exec "$(cat container_id)" "$PYTHON" -m pep8 --ignore=E402 test.py
- docker exec "$(cat container_id)" "$PYTHON" -m pyflakes test.py
after_script:
# stop the container
- docker stop "$(cat container_id)"