forked from ckeditor/ckeditor4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (100 loc) · 3.47 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
branches:
only:
- next
- master
- major
- stable
- latest
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
- /^release\/\d+\.\d+\.x$/
- /^[\d]{4,5}security$/
git:
depth: false
env:
global:
- FULL_RUN=$(if [ "$FULL_RUN_TRAVIS_CFG" != "" ]; then echo "$FULL_RUN_TRAVIS_CFG"; elif [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then echo "fullRun"; else echo ""; fi)
- REPO_NAME=$(IFS='/' read -r -a array <<< "$TRAVIS_REPO_SLUG"; echo ${array[1]};)
- TARGET_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo "$TRAVIS_BRANCH^"; else echo "$TRAVIS_BRANCH"; fi)
- CURRENT_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo "$TRAVIS_BRANCH"; else echo "$TRAVIS_PULL_REQUEST_BRANCH"; fi)
jobs:
exclude:
- language: ruby
include:
- name: Chrome (Linux)
os: linux
dist: xenial
language: node_js
node_js: 10
services:
- xvfb
addons:
chrome: stable
install:
- npm install npm@7 -g
- npm --version
before_script:
- echo $TRAVIS_EVENT_TYPE
# Setup xvfb
- 'export DISPLAY=:99.0'
- 'sleep 3'
# Setup CKEditor 4 testing environment
- pwd
- npm install benderjs-cli -g
- npm i
# Setup additional dependency
- |
if [[ "$EXTRA_DEPS_TRAVIS" == "true" ]]; then
git clone $DEPS_TRAVIS $DEPS_LOCATION_TRAVIS --quiet
cd $DEPS_LOCATION_TRAVIS
git checkout $TRAVIS_PULL_REQUEST_BRANCH || true
cd ../..
fi
# Setup bender test runner
- cd ..
- pwd
- git clone https://github.com/ckeditor/ckeditor4-benderjs-runner.git --branch v1.2.0 --single-branch
- cd ckeditor4-benderjs-runner
- npm i
script:
- pwd
- echo "Running tests based on diff between $TARGET_BRANCH and $CURRENT_BRANCH"
- npm run start -- --configFile "../../$REPO_NAME/bender-runner.config.json" --targetBranch "$TARGET_BRANCH" --currentBranch "$CURRENT_BRANCH" --browser "chrome" --fullRun "$FULL_RUN" --repoPath "../$REPO_NAME/" --prRepoSlug "$TRAVIS_PULL_REQUEST_SLUG"
- name: Firefox (Linux)
os: linux
dist: xenial
language: node_js
node_js: 10
services:
- xvfb
addons:
firefox: latest
install:
- npm install npm@7 -g
- npm --version
before_script:
- echo $TRAVIS_EVENT_TYPE
# Setup xvfb
- 'export DISPLAY=:99.0'
- 'sleep 3'
# Setup CKEditor 4 testing environment
- pwd
- npm install benderjs-cli -g
- npm i
# Setup additional dependency
- |
if [[ "$EXTRA_DEPS_TRAVIS" == "true" ]]; then
git clone $DEPS_TRAVIS $DEPS_LOCATION_TRAVIS --quiet
cd $DEPS_LOCATION_TRAVIS
git checkout $TRAVIS_PULL_REQUEST_BRANCH || true
cd ../..
fi
# Setup bender test runner
- cd ..
- pwd
- git clone https://github.com/ckeditor/ckeditor4-benderjs-runner.git --branch v1.2.0 --single-branch
- cd ckeditor4-benderjs-runner
- npm i
script:
- pwd
- echo "Running tests based on diff between $TARGET_BRANCH and $CURRENT_BRANCH"
- npm run start -- --configFile "../../$REPO_NAME/bender-runner.config.json" --targetBranch "$TARGET_BRANCH" --currentBranch "$CURRENT_BRANCH" --browser "firefox" --fullRun "$FULL_RUN" --repoPath "../$REPO_NAME/" --prRepoSlug "$TRAVIS_PULL_REQUEST_SLUG"