forked from SAP/luigi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
127 lines (118 loc) · 6.45 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
version: ~> 1.0 # enables build config validation beta feature: https://docs.travis-ci.com/user/build-config-validation
language: node_js
node_js:
- '11.14' #TODO: change it to 'node' once Travis supports the newest version
dist: xenial
cache:
directories:
- $TRAVIS_BUILD_DIR/client/public
- $TRAVIS_BUILD_DIR/core/public
- $TRAVIS_BUILD_DIR/client/public-ie11
- $TRAVIS_BUILD_DIR/core/public-ie11
- $TRAVIS_BUILD_DIR/plugins/auth/public/auth-oauth2
- $TRAVIS_BUILD_DIR/plugins/auth/public/auth-oidc
- $TRAVIS_BUILD_DIR/test/e2e-test-application/dist
- $TRAVIS_BUILD_DIR/website/fiddle/public
- $TRAVIS_BUILD_DIR/cypress-binary-cache
- $HOME/.cache/Cypress
notifications:
slack:
secure: wiOchVgoiKNUikjCeIhsuv3Y5jolFud6ercdZdO3+JigQqkmoAC95f2jKTYEdplJWyJr8JY6z0+UJNceHyr5YJx/l1wpm6Zq+3H4dq/V0yUXH1uhw2eaTzweX2vjfw0bzewEdc1CGl4kSfdyTajnbKgt+mtnrAV9lPqiXYSOOJTu5BCFomi7u2GhAz1JjBK6P4Ar2jXm+oc81nYjj40P8bZFlA7Rjm0hNN42MMkKvnD8OHztL3EwezKHXlQW7fN4eOrhPOMbT3NRU72g9Nir+lfoKJlch1zPoHXQ7DRp41uGyHV/qfvfRLzXwxftZK6kdvzMe0eI0i1aIm0R6AE0bLphB2o/klJzyQpqSiQgETTH0qJN+3px2kddGrw7Me+UNC/1zZrt1MJfWf0h6WjXTsPDJf3ajLsn8OoIeBTRZbAb9as3UWQZcknuuMf8oGUzZkrZNMWYqo3py0+qWm4wSbWXWVUCgVAIYA6oEADwq37z59HySGkyHI4gEPzxsYODfCuvO4pJX1h4vEyH7w2IigwhDAPq5G4Vdez9ZFS96p/LSCF+iH8yWMy294u8wk5ofWUutFFv0JC45LQBXu51a2TeQkalwVn4DiuxxHE6jZieREw75YFjra4jpWsyziWkzshGT75NCra6cKAbNa4T8n6Pm3ogjEPeeWAO3psgSdo=
integration-testing: &integration-testing
script:
- export CYPRESS_CACHE_FOLDER=$TRAVIS_BUILD_DIR/cypress-binary-cache
- ls $CYPRESS_CACHE_FOLDER
- bash ./test/e2e.sh
addons:
apt:
packages:
# Ubuntu 16+ does not install this dependency by default, so we need to install it ourselves
- libgconf-2-4
#- chromium-browser=79.0.3945.130-0ubuntu0.16.04.1 # update also if you upgrade from Xenial
# chrome: beta
chrome: stable
before_install:
# - chromium-browser --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
# - google-chrome-beta --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache
- rm -rf ~/.cache/Cypress/cy/production/browsers #it is individual for each run anyway so caching it slows down the job
jobs:
include:
- stage: 'Precache & Unit Tests'
script:
- export CYPRESS_CACHE_FOLDER=$TRAVIS_BUILD_DIR/cypress-binary-cache
- npm i -g lerna
- lerna bootstrap --ci --force-local --ignore docs || travis_terminate 1
# WORKAROUND - START
# Due to open bug at lerna, https://github.com/lerna/lerna/issues/2352
# Link e2e-test-application manually:
- rm -rf $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/*
- ln -s $TRAVIS_BUILD_DIR/core/public $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/core
- ln -s $TRAVIS_BUILD_DIR/client/public $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/client
- ln -s $TRAVIS_BUILD_DIR/plugins/auth/public/auth-oauth2 $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/plugin-auth-oauth2
- ln -s $TRAVIS_BUILD_DIR/plugins/auth/public/auth-oidc $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/plugin-auth-oidc
# Link fiddle manually:
- rm -rf $TRAVIS_BUILD_DIR/website/fiddle/node_modules/@luigi-project/*
- ln -s $TRAVIS_BUILD_DIR/core/public $TRAVIS_BUILD_DIR/website/fiddle/node_modules/@luigi-project/core
- ln -s $TRAVIS_BUILD_DIR/client/public $TRAVIS_BUILD_DIR/website/fiddle/node_modules/@luigi-project/client
- ln -s $TRAVIS_BUILD_DIR/plugins/auth/public/auth-oauth2 $TRAVIS_BUILD_DIR/website/fiddle/node_modules/@luigi-project/plugin-auth-oauth2
- ln -s $TRAVIS_BUILD_DIR/plugins/auth/public/auth-oidc $TRAVIS_BUILD_DIR/website/fiddle/node_modules/@luigi-project/plugin-auth-oidc
# WORKAROUND - END
- lerna run bundle --ignore docs || travis_terminate 1
- lerna run bundlesizeOnly --ignore docs || travis_terminate 1
# Verifying step
- head $TRAVIS_BUILD_DIR/client/public/package.json
- ls -lah $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project
- ls -lah $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/client/
- echo "check if luigi-client.d.ts exists" && cat $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/client/luigi-client.d.ts | grep -C 3 "withoutSync" || travis_terminate 1
- lerna run build --ignore docs || travis_terminate 1
- npm test --prefix core || travis_terminate 1
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache
- rm -rf $TRAVIS_BUILD_DIR/core/examples
#----- DOCU -----
- stage: 'Documentation & Tests'
name: 'Check Documentation'
script:
- cd $TRAVIS_BUILD_DIR/scripts && npm ci
- cd $TRAVIS_BUILD_DIR && bash ./scripts/docuCheck.sh
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache
#----- WHITESOURCE -----
- name: 'Whitesource check'
if: repo = SAP/luigi AND branch = master
# if: repo = SAP/luigi AND (branch = master OR branch = release-v1)
# Whitesource can't deal with symlinking, therefore we can't use lerna
script:
- 'if [ ! -z "${WHITESOURCE_APIKEY}" ]; then
npm --prefix ./client ci ./client;
npm --prefix ./core ci ./core;
npm --prefix ./website/landingpage/dev install ./website/landingpage/dev;
npm --prefix ./website/fiddle install ./website/fiddle;
npm i -g whitesource;
bash ./scripts/whiteSource.sh;
fi'
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache
# ----- INTEGRATION -----
- name: 'Integration Testing 1'
<<: *integration-testing
- name: 'Integration Testing 2'
<<: *integration-testing
# ----- NPM PUBLISH -----
- stage: 'Publish'
name: 'Publish to NPM'
# run only when merging from release-v branch to master
# if: repo = SAP/luigi AND (branch = master OR branch ~= ^release-v)
if: repo = SAP/luigi AND branch = master
script:
- bash ./scripts/npmPublish.sh
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache