-
Notifications
You must be signed in to change notification settings - Fork 375
50 lines (42 loc) · 1.57 KB
/
test.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
name: test
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm i && npm run lint
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
id: cache
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
node_modules
test/e2e/miniprogram-project/node_modules
test/e2e/plugin-project/node_modules
packages/webpack-plugin/node_modules
packages/core/node_modules
packages/api-proxy/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install deps
if: steps.cache.outputs.cache-hit != 'true'
run: npm i && npm i --prefix test/e2e/miniprogram-project && npm i --prefix test/e2e/plugin-project
- name: copy-webpack-plugin
run: npm run copyPlugin --prefix test/e2e/miniprogram-project && npm run copyPlugin --prefix test/e2e/plugin-project
- name: build-miniprogram
run: npm run build:cross --prefix test/e2e/miniprogram-project
- name: build-plugin
run: npm run build --prefix test/e2e/plugin-project
- name: exec unit test
run: npm t && npm t --prefix test/e2e/miniprogram-project && npm t --prefix test/e2e/plugin-project