-
Notifications
You must be signed in to change notification settings - Fork 63
133 lines (116 loc) · 3.27 KB
/
node.js.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Node CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:
secrets:
BROWSERSTACK_USERNAME:
required: true
BROWSERSTACK_ACCESS_KEY:
required: true
jobs:
unit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: |
package-lock.json
packages/core/package-lock.json
packages/gatsby-plugin/package-lock.json
packages/js/package-lock.json
packages/nextjs/package-lock.json
packages/react/package-lock.json
packages/react-native/package-lock.json
packages/rollup-plugin/package-lock.json
packages/vue/package-lock.json
packages/webpack/package-lock.json
- name: Build
run: npm ci
- name: Run unit tests
run: npm test
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
core: ${{ steps.filter.outputs.core }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'packages/core/**'
- 'packages/js/**'
integration:
needs: changes
if: needs.changes.outputs.core == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '14.x'
cache: 'npm'
cache-dependency-path: |
package-lock.json
packages/js/package-lock.json
- name: Build
run: npm ci
- name: Install Playwright Browsers
run: |
cd packages/js
npx playwright install --with-deps
- name: Run integration tests
env:
CI: true
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
run: |
cd packages/js
npm run test:integration
- name: Upload Playwright Report
uses: actions/upload-artifact@v3
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '14.x'
cache: 'npm'
cache-dependency-path: |
package-lock.json
packages/js/examples/aws-lambda-typescript/package-lock.json
packages/vue/examples/vue2/package-lock.json
packages/vue/examples/vue3/package-lock.json
packages/react-native/example/package-lock.json
packages/nextjs/examples/app-router/package-lock.json
packages/nextjs/examples/pages-router/package-lock.json
- name: Build
run: npm ci
- name: Run lint checks
run: npm run lint