forked from systemd/pystemd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
63 lines (56 loc) · 1.78 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
58
59
60
61
62
63
language: python
os: linux
env:
global:
- CONT_NAME="pystemd-$TRAVIS_BUILD_NUMBER"
- DOCKER_EXEC="sudo docker exec -it $CONT_NAME"
before_install: |
if [ -n "$PYTHON_VERSION" ]; then
CONT_OS="ubuntu:bionic"
# setup container
sudo docker pull $CONT_OS
sudo docker run -v $TRAVIS_BUILD_DIR:/build:rw -w /build --privileged=true --name $CONT_NAME -dit --net=host $CONT_OS /bin/bash
$DOCKER_EXEC /usr/bin/apt update
if [ "$PYTHON_VERSION" != 3 ]; then
$DOCKER_EXEC /usr/bin/apt install -y software-properties-common
$DOCKER_EXEC /usr/bin/add-apt-repository -y ppa:deadsnakes/ppa
$DOCKER_EXEC /usr/bin/apt update
fi
# setup venv and install dependencies
$DOCKER_EXEC /usr/bin/apt install -y \
gcc \
libsystemd-dev \
pandoc \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-venv
$DOCKER_EXEC /usr/bin/python${PYTHON_VERSION} -m venv /build/venv
$DOCKER_EXEC /build/venv/bin/pip3 install -r requirements.txt Cython
$DOCKER_EXEC /build/venv/bin/pip3 install Cython
$DOCKER_EXEC /build/venv/bin/python3 setup.py sdist
fi
install:
- $DOCKER_EXEC /build/venv/bin/pip3 install dist/pystemd*.tar.gz
script:
- $DOCKER_EXEC /bin/bash -c "cd tests && /build/venv/bin/python3 -m unittest discover"
matrix:
include:
- dist: xenial
sudo: required
name: "Python 3.4"
env: PYTHON_VERSION=3.4
- dist: xenial
sudo: required
name: "Python 3.5"
env: PYTHON_VERSION=3.5
- dist: xenial
sudo: required
name: "Python 3.6"
env: PYTHON_VERSION=3
- dist: xenial
sudo: required
name: "Python 3.7"
env: PYTHON_VERSION=3.7
- name: "Black formatting"
python: 3.6
install: pip install black
script: black --check .