Skip to content

Commit e7a1472

Browse files
committed
chore: ci use yarn
1 parent b702e9a commit e7a1472

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

.travis.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,28 @@ os: linux
55
dist: xenial
66
arch: amd64
77
cache:
8+
yarn: true
89
directories:
910
- node_modules
1011
jobs:
1112
include:
1213
- stage: test
14+
before_install:
15+
- curl -o- -L https://yarnpkg.com/install.sh | bash
16+
- export PATH="$HOME/.yarn/bin:$PATH"
1317
install:
14-
- npm install
18+
- yarn --frozen-lockfile
1519
script:
16-
- npm run test:ci
20+
- yarn run test:ci
1721
- stage: release
22+
if: "(branch = master) AND (NOT (type IN (pull_request))) AND (tag =~ /^v2/)"
23+
before_install:
24+
- curl -o- -L https://yarnpkg.com/install.sh | bash
25+
- export PATH="$HOME/.yarn/bin:$PATH"
1826
install:
19-
- npm install
27+
- yarn --frozen-lockfile
2028
script:
21-
- npm run prepublishOnly
29+
- yarn run prepublishOnly
2230
deploy:
2331
provider: npm
2432
@@ -31,9 +39,9 @@ jobs:
3139
- stage: deploy
3240
if: "(branch = master) AND (NOT (type IN (pull_request)))"
3341
install:
34-
- npm install
42+
- yarn --frozen-lockfile
3543
script:
36-
- npm run build:doc
44+
- yarn run build:doc
3745
after_script:
3846
- cd site
3947
- git init

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,26 +188,26 @@
188188
]
189189
},
190190
"scripts": {
191-
"dev:weapp": "npm run build:weapp -- --watch",
192-
"dev:qq": "npm run build:qq -- --watch",
193-
"dev:h5": "npm run build:h5 -- --watch",
194-
"dev:swan": "npm run build:swan -- --watch",
195-
"dev:alipay": "npm run build:alipay -- --watch",
196-
"dev:doc": "npm run build:h5-static && node ./build/dev-server",
191+
"dev:weapp": "yarn run build:weapp -- --watch",
192+
"dev:qq": "yarn run build:qq -- --watch",
193+
"dev:h5": "yarn run build:h5 -- --watch",
194+
"dev:swan": "yarn run build:swan -- --watch",
195+
"dev:alipay": "yarn run build:alipay -- --watch",
196+
"dev:doc": "yarn run build:h5-static && node ./build/dev-server",
197197
"build:weapp": "taro build --type weapp",
198198
"build:qq": "taro build --type qq",
199199
"build:h5": "taro build --type h5",
200200
"build:swan": "taro build --type swan",
201201
"build:alipay": "taro build --type alipay",
202202
"build:component": "cross-env TARO_BUILD_TYPE=component taro build --ui",
203-
"build:h5-static": "npm run build:h5 && node ./build/build-static",
204-
"build:doc": "npm run build:h5-static && node ./build/build-docs",
205-
"prepublishOnly": "npm run clean && npm run build:component",
203+
"build:h5-static": "yarn run build:h5 && node ./build/build-static",
204+
"build:doc": "yarn run build:h5-static && node ./build/build-docs",
205+
"prepublishOnly": "yarn run clean && yarn run build:component",
206206
"lint": "eslint ./src --fix",
207207
"lint:style": "stylelint \"src/**/*.scss\" --syntax scss",
208208
"lint:style-fix": "stylelint \"src/**/*.scss\" --syntax scss --fix",
209209
"test": "cross-env NODE_ENV=test && jest --coverage",
210-
"test:ci": "npm run build:h5 && npm run test",
210+
"test:ci": "yarn run build:h5 && yarn run test",
211211
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
212212
"clean": "rimraf .temp dist coverage"
213213
},

0 commit comments

Comments
 (0)