This repository has been archived by the owner on Jul 26, 2018. It is now read-only.
forked from web-platform-tests/results-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
90 lines (78 loc) · 2.51 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright 2017 The WPT Dashboard Project. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
sudo: required
services:
- docker
matrix:
include:
- language: python
env:
- WCT=1
- language: python
env:
- MAKE_DEPS_TARGET=py_deps
- MAKE_TEST_TARGET=py_lint
- language: python
env:
- MAKE_DEPS_TARGET=py_deps
- MAKE_TEST_TARGET=py_test
- language: go
env:
- MAKE_DEPS_TARGET=go_deps
- MAKE_TEST_TARGET=go_lint
- language: go
env:
- MAKE_DEPS_TARGET=go_deps
- MAKE_TEST_TARGET=go_test
# Disabled while this is not in use.
# - language: python
# env:
# - DOCKER_FILE=Dockerfile.jenkins
# - DOCKER_IMAGE=wptd-testrun-jenkins
# - DOCKER_INSTANCE=wptd-testrun-jenkins-${RANDOM}
# - MAKE_DEPS_TARGET=jenkins_install
# - MAKE_TEST_TARGET=jenkins_test
before_install: |
export DOCKER_FILE=Dockerfile.dev
export DOCKER_IMAGE=wptd-dev
export DOCKER_INSTANCE=wptd-dev-${RANDOM}
# Disabled while this is not in use.
# if [ "${MAKE_TEST_TARGET}" == "jenkins_test" ]; then
# DOCKER_FILE=Dockerfile.jenkins
# DOCKER_IMAGE=wptd-testrun-jenkins
# fi;
docker build -t wptd-base -f Dockerfile.base .
docker build -t "${DOCKER_IMAGE}" -f "${DOCKER_FILE}" .
docker run -t -d --entrypoint /bin/bash -v /etc/group:/etc/group:ro -v /etc/passwd:/etc/passwd:ro -v "$(pwd)":/home/jenkins/wptdashboard -u $(id -u $USER):$(id -g $USER) --name "${DOCKER_INSTANCE}" "${DOCKER_IMAGE}"
install: |
if [ "${WCT}" == "1" ]; then
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 6
node --version
cd webapp
npm install -g bower
bower install
npm install -g web-component-tester
npm install
cd ../
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
fi
if [ "${MAKE_DEPS_TARGET}" != "" ]; then
docker exec -t -u 0:0 "${DOCKER_INSTANCE}" make "${MAKE_DEPS_TARGET}";
fi
docker exec -u 0:0 "${DOCKER_INSTANCE}" chown -R $(id -u $USER):$(id -g $USER) /home/jenkins
script:
- |
if [ "${MAKE_TEST_TARGET}" != "" ]; then
docker exec -t -u $(id -u $USER):$(id -g $USER) "${DOCKER_INSTANCE}" make "${MAKE_TEST_TARGET}"
fi
- |
if [ "${WCT}" == "1" ]; then
cd webapp && npm test
fi
after_script:
- docker stop "${DOCKER_INSTANCE}"
- docker rm "${DOCKER_INSTANCE}"