-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (121 loc) · 3.54 KB
/
dev.yml
File metadata and controls
129 lines (121 loc) · 3.54 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
name: Build and test
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BASE_NODE_VERSION: 24
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run build
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: ${{ env.BASE_NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm run format:check
- run: npm run lint
- run: npm run check:error-codes
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@v6
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@v6
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@v6
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 }}
# Dummy keys for Next.js build - module-level SDK client initialization
# runs during bundling even though the routes are never called at build time
env:
ABLY_API_KEY: dummy:key