-
Notifications
You must be signed in to change notification settings - Fork 3
129 lines (112 loc) · 3.72 KB
/
tests.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
name: Tests
on:
- workflow_dispatch
- push
- pull_request
jobs:
# This job lints all files with ESLint.
lint:
if: contains(github.event.head_commit.message, 'skip ci') == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint files
run: npm run lint
- name: Test that components are tree shakable.
run: npm run lint:tree-shaking
# This job runs all Cypress tests.
cypress-test:
if: contains(github.event.head_commit.message, 'skip ci') == false
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
matrix:
os:
- ubuntu-latest
# TODO: Re-enable once a public release of the library is available.
# Mac and windows env's take significantly longer to run.
# - macos-latest
# - windows-latest
node:
- 18
- 20
- 22
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Timezone
uses: szenius/set-timezone@v2.0
with:
timezoneLinux: 'America/New_York'
timezoneMacos: 'America/New_York'
timezoneWindows: 'Eastern Standard Time'
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Clear Vite cache
run: rm -rf node_modules/.vite/deps
- name: E2E tests on Node v${{ matrix.node }}
if: github.actor == 'dependabot[bot]'
uses: cypress-io/github-action@v6
with:
command: npm run test:e2e
record: false
env:
TZ: America/New_York
- name: Component tests on Node v${{ matrix.node }}
if: github.actor == 'dependabot[bot]'
uses: cypress-io/github-action@v6
with:
# We have already installed everything.
install: false
command: npm run test:component
record: false
env:
TZ: America/New_York
- name: Cypress.io E2E tests on Node v${{ matrix.node }}
if: github.actor != 'dependabot[bot]'
uses: cypress-io/github-action@v6
with:
command: npm run test:e2e -- --record
record: true
tag: node-${{ matrix.node }},e2e
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TZ: America/New_York
- name: Cypress.io component tests on Node v${{ matrix.node }}
if: github.actor != 'dependabot[bot]'
uses: cypress-io/github-action@v6
with:
# We have already installed everything.
install: false
command: npm run test:component -- --record
record: true
tag: node-${{ matrix.node }},component
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TZ: America/New_York
- name: Upload coverage to Codecov
if: github.actor != 'dependabot[bot]'
uses: codecov/codecov-action@v4.6.0
with:
file: ./coverage/lcov.info
- name: Automatically merge dependabot updates
if: github.event_name == 'pull_request'
uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE }}