-
Notifications
You must be signed in to change notification settings - Fork 40
73 lines (61 loc) · 1.79 KB
/
ci.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
name: Continuous Integration
on:
push:
branches:
- main
- v1.x
pull_request:
branches:
- main
- v1.x
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
node-version: [18.15.x, 20.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out git repository
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install project dependencies
run: |
yarn install --frozen-lockfile
- name: Build all packages
run: |
yarn build
# https://github.com/amplitude/Amplitude-TypeScript/issues/281
- name: Check module dependencies
run: |
if grep -rnw 'packages/analytics-core/lib' -e '/// <reference types="node" />'; then
exit 1
elif grep -rnw 'packages/analytics-browser/lib' -e '/// <reference types="node" />'; then
exit 1
elif grep -rnw 'packages/analytics-marketing-analytics-browser/lib' -e '/// <reference types="node" />'; then
exit 1
elif grep -rnw 'packages/analytics-react-native/lib' -e '/// <reference types="node" />'; then
exit 1
fi
- name: Build docs
run: |
yarn docs:check
- name: Test all packages
run: |
yarn test
- name: Test all examples
run: |
yarn test:examples
- name: Lint all packages
run: |
yarn lint