forked from canonical/snapcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (48 loc) · 3.22 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
sudo: required
dist: trusty
services: [docker]
language: python
python: [3.4]
virtualenv:
system_site_packages: true
env:
global:
- INTEGRATION_DEPENDENCIES="apt install -y bzr curl git libnacl-dev libsodium-dev libffi-dev libapt-pkg-dev libarchive-dev mercurial python3-pip subversion squashfs-tools sudo snapd xdelta3 && python3 -m pip install -r requirements-devel.txt -r requirements.txt"
matrix:
- DOCKER=1 CHECK_CLA=1 DEPENDENCIES="apt install -y git python-launchpadlib"
- DOCKER=1 TEST_SUITE=static DEPENDENCIES="apt install -y python3-pip && python3 -m pip install -r requirements-devel.txt"
- DOCKER=1 TEST_SUITE=unit DEPENDENCIES="apt install -y git bzr subversion mercurial libnacl-dev libsodium-dev libffi-dev libapt-pkg-dev libarchive-dev python3-pip squashfs-tools xdelta3 && python3 -m pip install -r requirements-devel.txt -r requirements.txt && python3 -m pip uninstall -y coverage && apt install -y python3-coverage"
- DOCKER=1 TEST_SUITE=integration DEPENDENCIES=$INTEGRATION_DEPENDENCIES
- DOCKER=1 TEST_SUITE=store DEPENDENCIES=$INTEGRATION_DEPENDENCIES
- DOCKER=1 GEN_DOCS=1 DEPENDENCIES="apt install libnacl-dev libsodium-dev libffi-dev libapt-pkg-dev libarchive-dev git make python3-pip python3-sphinx -y && python3 -m pip install -r requirements-devel.txt -r requirements.txt"
- DOCKER=1 TEST_SUITE=beta DEPENDENCIES="apt install -y python3-git python3-github wget"
addons:
apt:
packages:
- python3-coverage
install:
- if [ ! -z $DOCKER ]; then docker run --name builder
-e TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE
-e TEST_USER_EMAIL=$TEST_USER_EMAIL -e TEST_USER_PASSWORD=$TEST_USER_PASSWORD
-e TEST_STORE=$TEST_STORE -e TEST_SNAP_WITH_TRACKS=$TEST_SNAP_WITH_TRACKS
-e GITHUB_TEST_USER_NAME=$GITHUB_TEST_USER_NAME -e GITHUB_TEST_PASSWORD=$GITHUB_TEST_PASSWORD
-e SNAPCRAFT_AUTOPKGTEST_SECRET=$SNAPCRAFT_AUTOPKGTEST_SECRET -e GH_TOKEN=$GH_TOKEN
-e LC_ALL=en_US.UTF-8
-v $PWD:$PWD -w $PWD -td ubuntu:xenial; fi
- if [ ! -z $DOCKER ]; then docker exec -i builder locale-gen en_US.UTF-8; fi
- if [ ! -z $DOCKER ]; then docker exec -i builder sed -i s/archive.ubuntu.com/us.archive.ubuntu.com/g /etc/apt/sources.list; fi
- if [ ! -z $DOCKER ]; then docker exec -i builder apt update; fi
- if [ ! -z $DOCKER ]; then docker exec -i builder sh -c "$DEPENDENCIES"; fi
script:
# CLA check, only in pull requests.
- if [ ! -z $CHECK_CLA ] && [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_EVENT_TYPE" != 'cron' ]; then docker exec -i builder ./tools/cla_check_in_travis.sh; fi
# Test suites from runtests.sh, in pull requests and landings to master.
- if [ ! -z $TEST_SUITE ] && [ "$TEST_SUITE" != "beta" ] && [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then docker exec -i builder ./runtests.sh $TEST_SUITE; fi
# Trigger beta tests, only in the daily cron.
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ] && [ "$TEST_SUITE" == "beta" ]; then docker exec -i builder ./tools/make_beta_pr.py; fi
# Generate docs, only in pushes to master.
- if [ ! -z $GEN_DOCS ] && [ "$TRAVIS_EVENT_TYPE" = "push" ] && [ "$TRAVIS_BRANCH" = "master" ]; then docker exec -i builder ./tools/gen_api_docs.sh && ./tools/push_api_gh_pages.sh; fi
after_success:
- python3 -m coverage xml
- pip install codecov
- codecov