-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
169 lines (160 loc) · 8.58 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
version: ~> 1.0 # enables build config validation beta feature: https://docs.travis-ci.com/user/build-config-validation
language: node_js
node_js:
- '12.18.4' #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/test/e2e-test-application/externalMf
- $TRAVIS_BUILD_DIR/website/fiddle/public
- $TRAVIS_BUILD_DIR/cypress-binary-cache
- $TRAVIS_BUILD_DIR/client-frameworks-support/client-support-angular
- $TRAVIS_BUILD_DIR/client-frameworks-support/testing-utilities/dist
- $HOME/.cache/Cypress
notifications:
slack:
secure: nls0RW4RKEHLnRBgOi25UTpjjSBFGnXgOnbxuiPsSjBFWehXvH8SfMYGfsDdp6lfH9ljDFA6KiJFauAAgQ+vImaZNHvrHeCitQDqWraXeD1CyzOYGp+8Bx/JyR1bcBKewvQVqNpnhk4hoIEI4Gu2i1NGq1/pAkHOeetw7PVmnpEG/QyQQ8YDXbySzWl39iZc8HWVT4svKV8BqYx+KzqRqE09XSfhiecZ00DVjZEMyKD6oCttOlJ/Vo0Z7QgzAEDaIhb+jrojJ2HD1PPWjiQqfpuyBY6GjeFGwNebevhmVngvQ3+69xn0ydOct3HTR/uSNJexY/Hq9W98QuGliihWwx1ksjFZnKtZ42FRY9p8jD/hw+ySJRwrAvbZtrWA0xmU85Fz/kRMocum5I7UJDGOTvklNYMFT/Rlh5w08DWXx8YCYyvXxsTee7dNELwefYnOL/FZRzHaNKnXqimYsE8dIlbfMBKD2Kh4Hr0+NZlBBaZ71w2+4Cp1mdJnSEFN7zuOrwqdQdjCDAeqttcSOvuQAR/BMGwtN30BrjW16n2YOuqwBoWsp7zUdpSyWp600mTn+vYulue4hvpwpbfELVXRtaggrVvolW9fBtACXE6+G9rqzJRgRLLNGM9i7dbiX2OFx1olMTu0n7XN7MNFdwFH4X0sycfi02GlZb/5L/ntrJY=
integration-testing: &integration-testing
if: repo = SAP/luigi AND type != cron AND type != api
script:
- export CYPRESS_CACHE_FOLDER=$TRAVIS_BUILD_DIR/cypress-binary-cache
- ls $CYPRESS_CACHE_FOLDER
- npm install --prefix $TRAVIS_BUILD_DIR/test/e2e-test-application @babel/plugin-proposal-class-properties
- 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
# needed dependencies for cypress 5.3.0
- libgtk2.0-0
- libgtk-3-0
- libgbm-dev
- libnotify-dev
- libgconf-2-4
- libnss3
- libxss1
- libasound2
- libxtst6
- xauth
- xvfb
# 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
- mkdir -p $TRAVIS_BUILD_DIR/client-frameworks-support/client-support-angular/node_modules/@luigi-project/
- rm -rf $TRAVIS_BUILD_DIR/client-frameworks-support/client-support-angular/node_modules/@luigi-project/*
- ln -s $TRAVIS_BUILD_DIR/client/public $TRAVIS_BUILD_DIR/client-frameworks-support/client-support-angular/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
# Make sure client is build first, required for client-support-angular
- lerna run bundle --ignore docs --scope luigi-client-private || travis_terminate 1
# Actual build
- 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
# ----- NPM PUBLISH -----
- stage: 'Documentation & Tests'
name: 'Compatibility tests'
# run only when merging from release-v branch to master
if: repo = SAP/luigi AND branch = master AND type = push
script:
# - bash -xv ./scripts/testCompatibility.sh --tag latest || travis_terminate 1 # to run with verbose mode
- bash ./scripts/testCompatibility.sh --tag latest || travis_terminate 1
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache
- rm -rf $TRAVIS_BUILD_DIR/../luigi-compatibility-testing # remove compatibility build cache
#----- DOCU -----
- name: 'Check Documentation'
if: repo = SAP/luigi AND type != cron AND type != api
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 AND type != cron AND type != api
# 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
# ----- NPM PUBLISH -----
- stage: 'Publish'
name: 'Publish to NPM'
# run only when a release in github was created
if: repo = SAP/luigi AND tag ~= ^v AND type != cron AND type != api
script:
- bash ./scripts/npmPublish.sh
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache
- name: 'Nightly release'
if: type = cron OR (type = api AND commit_message = publish)
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_LUI_AUTH_TOKEN" > ~/.npmrc
- cd $TRAVIS_BUILD_DIR/scripts && npm ci
- cd $TRAVIS_BUILD_DIR/scripts && NIGHTLY=true npm run release
- cd $TRAVIS_BUILD_DIR/scripts && npm run publish:nightly
- echo "" > ~/.npmrc
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache