forked from merlosy/ngx-material-file-input
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
91 lines (88 loc) · 2.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
dist: trusty
sudo: required
language: node_js
node_js:
- '12'
cache: npm
os:
- linux
addons:
chrome: stable
stages:
- validate
- deploy
before_install:
# Use a virtual display.
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# Install latest chrome.
- export CHROME_BIN=chromium-browser
install:
- npm ci
jobs:
include:
# *--------------------*
# | VALIDATE |
# *--------------------*
- stage: validate
name: "Lint"
script:
- npm run lint
- stage: validate
name: "Unit tests and Coverage"
node_js:
- '10'
- '11'
- '12'
before_script:
- 'sudo chown root /opt/google/chrome/chrome-sandbox'
- 'sudo chmod 4755 /opt/google/chrome/chrome-sandbox'
- npm install coveralls
script:
- echo "> Running tests against $(node -v)"
- npm run test:once -- --code-coverage
after_success:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
# *--------------------*
# | DEPLOY |
# *--------------------*
- stage: deploy
name: "Build and deploy"
script:
- npm run build:lib
- npm run build:demo
after_success:
- echo "Build successful - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"
before_deploy:
- zip -r9 ngx-material-file-input-$TRAVIS_TAG.zip dist/material-file-input
deploy:
- provider: pages
skip_cleanup: true
script: echo "> Deploying Demo to Github pages"
github_token: $GITHUB_TOKEN
keep-history: true
local_dir: dist/apps/demo-packaged
on:
repo: merlosy/ngx-material-file-input
branch: master
tags: true
- provider: releases
skip_cleanup: true
script: echo "> Drafting Github release"
api_key: $GITHUB_TOKEN
file_glob: true
file: ngx-material-file-input-$TRAVIS_TAG.zip
draft: true
on:
repo: merlosy/ngx-material-file-input
branch: master
tags: true
# - provider: npm
# skip_cleanup: true
# script: cd dist/material-file-input && echo "> Deploying package to NPM"
# email: $EMAIL
# api_key: $NPM_API_KEY
# on:
# repo: merlosy/ngx-material-file-input
# branch: master
# tags: true