@@ -10,19 +10,31 @@ concurrency:
10
10
cancel-in-progress : true
11
11
12
12
jobs :
13
- react17 :
14
- name : Test in React 17
13
+ build :
14
+ name : Build in React 17
15
15
runs-on : ubuntu-latest
16
- # Disable this job until we can reliably test in React 17
17
- # (or until we can remove the React 17 tests)
18
- if : false
16
+ outputs :
17
+ cache-primary-key : ${{ steps.build-cache.outputs.cache-primary-key }}
19
18
steps :
20
19
- uses : actions/checkout@v4
21
20
22
21
- name : pnpm
23
22
uses : pnpm/action-setup@v4
24
23
with :
25
24
version : 9.15.0
25
+ cache : false
26
+
27
+ - uses : actions/cache/restore@v4
28
+ name : Check for build cache
29
+ id : build-cache
30
+ with :
31
+ # Note: `path` doesn't like complex glob patterns (i.e. `+(charts|chat|packages|tools)`)
32
+ path : |
33
+ charts/*/dist/*
34
+ chat/*/dist/*
35
+ packages/*/dist/*
36
+ tools/*/dist/*
37
+ key : ${{ runner.os }}-REACT17-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/') }}
26
38
27
39
- name : Setup Node 18
28
40
uses : actions/setup-node@v4
@@ -32,17 +44,64 @@ jobs:
32
44
- name : Install node-gyp
33
45
run : pnpm add --global node-gyp
34
46
35
- - name : Install package.json
36
- run : pnpm install --prefer-offline
37
-
38
- - name : Build CLI
39
- run : pnpm build:cli
47
+ - name : Init React 17 environment
48
+ run : node ./scripts/react17/init.mjs
40
49
41
- - name : Install testing tools for React 17
42
- run : npx ts-node tools/test/scripts/install-react17.ts
50
+ - name : Install packages
51
+ run : pnpm install --prefer-offline # Intentionally not using --frozen-lockfile to allow for pnpm-lock.yaml updates
43
52
44
53
- name : Build packages
45
54
run : pnpm build
46
55
56
+ - uses : actions/cache/save@v4
57
+ name : Save build cache
58
+ if : ${{ steps.build-cache.outputs.cache-hit != 'true' }}
59
+ with :
60
+ path : |
61
+ charts/*/dist/*
62
+ chat/*/dist/*
63
+ packages/*/dist/*
64
+ tools/*/dist/*
65
+ key : ${{ steps.build-cache.outputs.cache-primary-key }}
66
+
67
+ test :
68
+ name : Test in React 17
69
+ runs-on : ubuntu-latest
70
+ needs : [build]
71
+ steps :
72
+ - name : Checkout code
73
+ uses : actions/checkout@v4
74
+
75
+ - name : Install pnpm
76
+ uses : pnpm/action-setup@v4
77
+ with :
78
+ version : 9.15.0
79
+ cache : false
80
+
81
+ - uses : actions/cache/restore@v4
82
+ name : Check for build cache
83
+ id : build-cache
84
+ with :
85
+ path : |
86
+ charts/*/dist/*
87
+ chat/*/dist/*
88
+ packages/*/dist/*
89
+ tools/*/dist/*
90
+ key : ${{needs.build.outputs.cache-primary-key}}
91
+
92
+ - name : Setup Node 18
93
+ uses : actions/setup-node@v4
94
+ with :
95
+ node-version : 18
96
+
97
+ - name : Install node-gyp
98
+ run : pnpm add --global node-gyp
99
+
100
+ - name : Init React 17 environment
101
+ run : node ./scripts/react17/init.mjs
102
+
103
+ - name : Install dependencies
104
+ run : pnpm install --prefer-offline # Intentionally not using --frozen-lockfile to allow for pnpm-lock.yaml updates
105
+
47
106
- name : Run tests in React 17
48
- run : pnpm run test --react17
107
+ run : pnpm run test --react17 --ci
0 commit comments