forked from typegoose/typegoose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
51 lines (51 loc) · 1.61 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
language: node_js
node_js: [
# check Latest
13,
12,
# check LTS
10,
# check against oldest supported
8,
]
script: | # this has to be used, otherwise it executes the tests twice (because of "default build script")
npm run mocha-ci
if [ $? -ne 0 ]; then exit 1; fi # this is added because sometimes it fails and exists with 0 in travis
if [ $TRAVIS_NODE_VERSION == "12" ]; then echo "Running Coverage" && npm run coverage; fi
stages:
- compile
- test
- deploy
jobs:
include:
- name: 'Test Compile Ability'
stage: compile
node_js: 10 # use version 10, because that speeds up the task, because travis's default is v10
script: |
(npm audit || exit 0)
npm run buildtests # build tests too to check if errors from tsc are present
# - name: 'Deploy to NPM'
# stage: deploy
# if: tag IS present AND NOT type IN (pull_request)
# script: skip
# deploy:
# provider: npm
# email: $DEPLOY_NPM_EMAIL
# tag: latest
# skip_cleanup: true
# api_key: $DEPLOY_NPM_KEY
# on:
# tags: true
- name: 'Deploy to GitHub Pages'
stage: deploy
if: branch IN (master) AND NOT type IN (pull_request) # i know this redundant, but it is needed otherwise the test will always create a deploy of this
script: bash ./ghPagesPre.sh
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_GH_PAGES
keep_history: false
target_branch: gh-pages # i know this the default, but just to be sure
on:
branch:
- master