-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis.yml
45 lines (38 loc) · 1.26 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
language: minimal
dist: focal
services: docker
sudo: required
env:
- IMAGE=python TAG=3.11-rc
- IMAGE=python TAG=3.10
- IMAGE=python TAG=3.9
- IMAGE=python TAG=3.8
- IMAGE=python TAG=3.7
- IMAGE=fedora TAG=rawhide
- IMAGE=centos TAG=stream9
- IMAGE=centos TAG=stream8
- IMAGE=debian TAG=latest
- IMAGE=ubuntu TAG=devel
before_install:
# Create a docker image called "myimage".
- docker build -t myimage -f ".travis/Dockerfile.${IMAGE}" --build-arg TAG="${TAG}" ".travis"
install:
# Install CI dependencies.
pip install --user codecov
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 tests in the running container.
- docker exec "$(cat container_id)" make ci
- docker exec "$(cat container_id)" make install test-install
after_success:
# Analyze the code coverage.
- docker exec "$(cat container_id)" coverage3 xml -i
- codecov
after_script:
# Stop the container.
- docker stop "$(cat container_id)"