forked from serverless/serverless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
132 lines (114 loc) · 5.94 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
language: node_js
git:
# Minimize git history, but ensure to not break things:
# - Merging multiple PR's around same time may introduce a case where it's not
# the last merge commit that is to be tested
depth: 10
cache:
# Not relying on 'npm' shortcut, as per Travis docs it's the only 'node_modules' that it'll cache
directories:
- $HOME/.npm
- node_modules
# Ensure to install dependencies at their latest versions
install:
# Note: with `npm update` there seems no way to update all project dependency groups in one run
- npm update --no-save # Updates just dependencies
# Note: npm documents --dev option for dev dependencies update, but it's only --save-dev that works
- npm update --save-dev --no-save # Updates just devDependencies
branches:
only:
- master # Do not build PR branches
- /^v\d+\.\d+\.\d+$/ # Ensure to build release tags
env:
global:
- SLS_IGNORE_WARNING=*
- FORCE_COLOR=1 # Ensure colored output (color support is not detected in some cases)
stages:
- name: Test
- name: Integration Test
if: branch = master AND type = push
- name: Deploy
if: tag =~ ^v\d+\.\d+\.\d+$
before_script:
# Fail build right after first script fails. Travis doesn't ensure that: https://github.com/travis-ci/travis-ci/issues/1066
# More info on below line: https://www.davidpashley.com/articles/writing-robust-shell-scripts/#idm5413512
- set -e
script:
- npm test -- -b # Bail after first fail
# Ensure to fail build if deploy fails, Travis doesn't ensure that: https://github.com/travis-ci/travis-ci/issues/921
before_deploy:
# Remove eventual old npm logs
- rm -rf ~/.npm/_logs
after_deploy:
- |
# npm creates log only on failure
if [ -d ~/.npm/_logs ]; then
# Undocumented way to force Travis build to fail
travis_terminate 1
fi
jobs:
include:
# In most cases it's best to configure one job per Platform & Node.js version combination
# (job boot & setup takes ca 1 minute, one task run usually lasts seconds)
# PR's
- name: 'Prettier check updated, Lint updated, Unit Tests - Linux - Node.js v12'
if: type = pull_request
node_js: 12
script:
- npm run prettier-check-updated
- npm run lint-updated
- npm test -- -b
# master branch and version tags
- name: 'Lint, Unit Tests - Linux - Node.js v12'
if: type != pull_request
node_js: 12
script:
- npm run lint
- npm test -- -b
- name: 'Unit Tests - Windows - Node.js v12'
os: windows
node_js: 12
before_install:
# Ensure Python 2 in Windows enviroment (Ruby is already preinstalled)
- |
if [ $TRAVIS_OS_NAME = windows ]
then
choco install python2 &&
export PATH="/c/Python27:/c/Python27/Scripts:$PATH"
fi
- name: 'Isolated Unit Tests, Package Integration Tests - Linux - Node.js v10'
node_js: 10
script:
- npm run test-isolated
- npm run integration-test-run-package
- name: 'Unit Tests, Coverage - Linux - Node.js v8'
node_js: 8
script: npm run coverage
after_success:
- |
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js || :
- rm -rf ./coverage
- name: 'Unit Tests - Linux - Node.js v6'
node_js: 6
- stage: Integration Test
name: 'Integration Tests - Linux - Node.js v12'
node_js: 12
env:
# AWS_ACCESS_KEY_ID
- secure: Ia2nYzOeYvTE6qOP7DBKX3BO7s/U7TXdsvB2nlc3kOPFi//IbTVD0/cLKCAE5XqTzrrliHINSVsFcJNSfjCwmDSRmgoIGrHj5CJkWpkI6FEPageo3mdqFQYEc8CZeAjsPBNaHe6Ewzg0Ev/sjTByLSJYVqokzDCF1QostSxx1Ss6SGt1zjxeP/Hp4yOJn52VAm9IHAKYn7Y62nMAFTaaTPUQHvW0mJj6m2Z8TWyPU+2Bx6mliO65gTPFGs+PdHGwHtmSF/4IcUO504x+HjDuwzW2itomLXZmIOFfGDcFYadKWzVMAfJzoRWOcVKF4jXdMoSCOviWpHGtK35E7K956MTXkroVoWCS7V0knQDovbRZj8c8td8mS4tdprUA+TzgZoHet2atWNtMuTh79rdmwoAO+IAWJegYj62Tdfy3ycESzY+KxSaV8kysG9sR3PRFoWjZerA7MhLZEzQMORXDGjJlgwLaZfYVqjlsGe5p5etFBUTd0WbFgSwOKLoA2U/fm7WzqItkjs3UWaHuvFVvwYixGxjEVmVczS6wa2cdGpHtVD9H7km4fPEzljHqQ26v0P5e8eylgqLF2IB6mL7UqGFrAtrMvAgN/M3gnq4dTs/wq1AJIOxEP7YW7kc0NAldk8vUz6t5GzCPNcuukxAku91Awnh0twxgUywatgJLZPY=
# AWS_SECRET_ACCESS_KEY
- secure: Dgaa5XIsA5Vbw/CYQLUAuVVsDX26C8+f1XYGwsbNmFQKbKvM8iy9lGrHlfrT3jftJkJH6re8tP1RjyZjjzLe25KPk4Tps7grNteCyiIIEDsC2aHhiXHD6zNHsItpxYusaFfyQinFWnK4CAYKWb9ZNIwHIDUIB4vq807QGAhYsnoj1Lg/ajWvtEKBwYjEzDz9OjB91lw7lpCnHtmKKw5A+TNIVGpDDZ/jRBqETsPaePtiXC9UTHZQyM3gFoeVXiJw9KSU/gjIx9REihCaWWPbnuQSeIONGGlVWY9V4DTZIsJr9/uwDcbioeXDD3G1ezGtNPPRSNTtq08QlUtE4mEtKea/+ObpllKZCeZGn6AJhMn+uqMIP95FFlqBB55YzRcLZY+Igi/qm/9LJ9RinAhxRVXiwzeQ+BdVA6jshAAzr+7wklux6lZAa0xGw9pgTv7MI4RP2LJ/LMP1ppFsnv9n/qt93Ax1VEwEu3xHZe3VTYL9tbXOPTZutf6fKjUrW7wSSuy637queESjYnnPKSb1vZcPxjSFlyh+GJvxu/3PurF9aqfiBdiorIBre+pQS4lakLtoft5nsbA+4iYUwrXR58qUPVUqQ7a0A0hedOWlp6g9ixLa6nugUP5aobJzR71T8l/IjqpnY2EEd/iINEb0XfUiZtB5zHaqFWejBtmWwCI=
script:
- npm run integration-test-run-basic || { npm run integration-test-cleanup; exit 1; }
- npm run integration-test-run-all || { npm run integration-test-cleanup; exit 1; }
- npm run integration-test-cleanup
- stage: Deploy
node_js: 12
script: skip
deploy:
provider: npm
email: services@serverless.com
on:
tags: true
api_key:
secure: EgoetjrRlGfvGnmVp8A0btr1CzB0hl7owVIpbfk4zXJzhGEbHoVu0CG0IdmyLN+JlaZa7EDJTjkDCd6g3fVAh9TT7ZCeaq8YwbZDrql7mAJj7xYQAyM4eSkc95BRzcFJBx7Mxr6H90IDLxKr6ZtB+HEdiHN+59XbepKYYJeb1jHfnKn5xzOqk4BdnZo6pKfudfeO+7/BwJJ0FwlFA40bY2HS/Lp+NG/2IedNR7k3m/5W83/XH5qlWP8jhBKlxrAzks27aNo+42xHkRCVyPViJKq0mfz1hl2bfswChWHgaCuajp+0amNL39pgIX9eXxFc3bNX9Iftox5t31elEhsw06vvuAaVkKEd+VEMaDySbQ9M+irKZeREg+NFYZLnc2WiEE3Sexo6hm9eM2q2KEZ7bleN9B0CQAut1XXLRQEts80rzss4Z2Q7AZb9cOYBQlj9Wf1X0Y74UqvnDn83a4Y38a+lhx7J2q691ZeM1UFSCdO0QfeJRkB55bSyHqUqrLAqUN7eNsKGdBH0kvYIGFREgGgReEpBRAuNqWuJ/5qexp63Kbf+09raG5IvfxSIM5fJ5KE5VxSduBdRnSH0GNKfjuq296/Rg4fmm/bygZ3Yk5L6Wd41SUU8uHzlZFBwtcvxAKDTQe6s+5JU24ilqxOx6J4Ut34X3dIbLLAmoB1ogdM=