forked from ipfs/js-ipfs-unixfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
101 lines (84 loc) · 2.93 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
language: node_js
cache: npm
dist: focal
branches:
only:
- master
- /^release\/.*$/
services:
- xvfb
stages:
- check
- test
- cov
- release
node_js:
- 'lts/*'
- 'node'
os:
- linux
- osx
- windows
before_install:
# prevents windows error: npm ERR! ... git-sh-setup: file not found
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH=/c/PROGRA~1/Git/usr/bin:/c/PROGRA~1/Git/mingw64/libexec/git-core:$PATH ; fi
# upgrading npm on travis/windows/node 14 is completely broken
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export NODE_INSTALL_DIR=`npm prefix -g` ; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then mv $NODE_INSTALL_DIR/node_modules $NODE_INSTALL_DIR/node_modules_old ; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then mkdir $NODE_INSTALL_DIR/node_modules ; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then rm -f $NODE_INSTALL_DIR/npm $NODE_INSTALL_DIR/npm.cmd $NODE_INSTALL_DIR/npm.ps1 $NODE_INSTALL_DIR/npx $NODE_INSTALL_DIR/npx.cmd $NODE_INSTALL_DIR/npx.ps1 ; fi
# workspaces require npm 7 or above
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then node $NODE_INSTALL_DIR/node_modules_old/npm/bin/npm-cli.js i -g npm@latest ; fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then npm install -g npm@latest ; fi
# allow windows to run scripts with node 14 and npm 7 (may not be necessary when node 14 is no longer lts)
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then npm config set script-shell c:/PROGRA~1/Git/bin/bash.exe ; fi
script: npx nyc -s npm run test -- -- -- -t node --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
jobs:
include:
- stage: check
name: linting
script:
- npm run lint
- stage: check
name: dep-check (production deps)
script:
- npm run depcheck -- $RUN_SINCE -- -- -p
- stage: check
name: dep-check (unused deps)
script:
- npm run depcheck -- $RUN_SINCE -- -- -- --unused
- stage: test
name: chrome
addons:
chrome: stable
script: npm run test -- -- -- -t browser
- stage: test
name: chrome webworker
addons:
chrome: stable
script: npm run test -- -- -- -t webworker
- stage: test
name: firefox
addons:
firefox: latest
script: npm run test -- -- -- -t browser --browsers FirefoxHeadless
- stage: test
name: firefox webworker
addons:
firefox: latest
script: npm run test -- -- -- -t webworker --browsers FirefoxHeadless
- stage: test
name: electron main
addons:
firefox: latest
script: npm run test -- -- -- -t electron-main
- stage: release
# only run on changes to master
if: branch = master AND type = push AND fork = false
name: release rc
script:
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
- npm run release:rc -- --yes
notifications:
email: false