-
Notifications
You must be signed in to change notification settings - Fork 113
150 lines (126 loc) · 4.37 KB
/
test.yml
File metadata and controls
150 lines (126 loc) · 4.37 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: 'Test'
on:
workflow_call:
inputs:
reportCoverage:
default: true
type: boolean
required: false
jobs:
mcp-server:
name: MCP Server
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: yarn install --immutable
- name: Generate MCP data
run: yarn build:mcp
- name: Run MCP server tests
run: yarn test:mcp:ci
playwright:
name: Playwright
runs-on: ubuntu-latest
strategy:
matrix:
react: ['18', '19']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: yarn install --immutable
- name: Install React 18
if: ${{ matrix.react == '18' }}
run: |
yarn add "@types/react@18" "@types/react-dom@18" --dev
yarn add react@18 react-dom@18
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-${{ matrix.react }}
path: packages
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: yarn test:pw:ci
- uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
if: ${{ inputs.reportCoverage && matrix.react == '19' }}
with:
file: temp/playwright-coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: playwright
cypress:
name: Cypress
runs-on: ubuntu-latest
strategy:
matrix:
spec:
- base
- charts
- cypress-commands
- main/src/components
- main/src/webComponents
- main/src/internal
- compat
react: ['18', '19']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: yarn install --immutable
- name: Override react-is for charts
if: ${{ matrix.react == '18' && matrix.spec == 'charts' }}
run: jq '.resolutions["react-is"] = "18"' package.json > tmp.json && mv tmp.json package.json
- name: Install 18
if: ${{ matrix.react == '18' }}
run: |
yarn add "@types/react@18" "@types/react-dom@18" --dev
yarn add react@18 react-dom@18
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-${{ matrix.react }}
path: packages
# TODO: remove once Cypress properly installs the binary via postinstall
- name: Install Cypress binary
run: npx cypress install
- name: Cypress run
uses: cypress-io/github-action@783cb3f07983868532cabaedaa1e6c00ff4786a8 # v7.1.9
with:
browser: chrome
component: true
spec: packages/${{ matrix.spec }}
install: false
- uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
if: ${{ inputs.reportCoverage && matrix.react == '19' }}
with:
file: temp/cypress-coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: ${{ matrix.spec }}
coveralls:
if: ${{ always() && inputs.reportCoverage }}
needs: ['cypress', 'playwright']
name: 'Combine Coverage'
runs-on: ubuntu-latest
steps:
- name: Coveralls
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
carryforward: 'base,charts,cypress-commands,main/src/components,main/src/internal,playwright'