-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (159 loc) · 4.34 KB
/
dev.yml
File metadata and controls
170 lines (159 loc) · 4.34 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Build and test
on:
push:
branches: [main]
pull_request:
env:
BASE_NODE_VERSION: 24
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run build
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run typecheck
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run format:check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run lint
check-error-codes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run check:error-codes
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm audit --production
test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
name: test node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
# Only collect coverage on the base Node version to avoid redundant work
- name: test with coverage
if: ${{ matrix.node-version == env.BASE_NODE_VERSION }}
run: npm test -- --coverage
- name: test
if: ${{ matrix.node-version != env.BASE_NODE_VERSION }}
run: npm test
# Post coverage summary as a PR comment. Restricted to PRs from the main
# repo (not forks) because the action needs write permissions that fork
# PRs don't have. Runs even if tests fail so we still get the report.
- uses: davelosert/vitest-coverage-report-action@v2
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == 'ably/ably-ai-transport-js' &&
matrix.node-version == env.BASE_NODE_VERSION &&
(failure() || success())
test-integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
name: test-integration node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run test:integration
demo-app:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
demo:
- demo/vercel/react/use-chat
- demo/vercel/react/use-client-transport
name: demo ${{ matrix.demo }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- name: npm ci (lib)
run: npm ci
- name: npm run build (lib)
run: npm run build
- name: npm ci (demo)
run: npm ci
working-directory: ${{ matrix.demo }}
- name: npm run build (demo)
run: npm run build
working-directory: ${{ matrix.demo }}