1
+ name : Run
2
+
3
+ on : [push]
4
+
5
+ concurrency : ${{ github.workflow }}-${{ github.ref }}
6
+
7
+ jobs :
8
+ install-and-cache :
9
+ name : Install and cache
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Checkout
14
+ uses : actions/checkout@v4
15
+
16
+ - uses : pnpm/action-setup@v4
17
+ name : Install pnpm
18
+ with :
19
+ version : 9
20
+ run_install : false
21
+
22
+ - name : Install Node.js
23
+ uses : actions/setup-node@v4
24
+ with :
25
+ node-version : 20
26
+ cache : ' pnpm'
27
+
28
+ - name : Get pnpm store directory
29
+ shell : bash
30
+ run : |
31
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
32
+
33
+ - uses : actions/cache@v4
34
+ name : Setup pnpm cache
35
+ with :
36
+ path : ${{ env.STORE_PATH }}
37
+ key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
38
+ restore-keys : |
39
+ ${{ runner.os }}-pnpm-store-
40
+
41
+ - name : Install dependencies
42
+ run : pnpm install
43
+
44
+ test-jest :
45
+ name : Jest tests
46
+ if : github.repository == 'apollographql/graphql-testing-library'
47
+ runs-on : ubuntu-latest
48
+ steps :
49
+ - name : Checkout repo
50
+ uses : actions/checkout@v4
51
+
52
+ - name : Install pnpm
53
+ uses : pnpm/action-setup@v4
54
+ with :
55
+ version : 9
56
+ run_install : false
57
+
58
+ - name : Install Node.js
59
+ uses : actions/setup-node@v4
60
+ with :
61
+ node-version : 20
62
+ cache : ' pnpm'
63
+
64
+ - name : Install dependencies
65
+ run : pnpm install
66
+
67
+ - name : Run Jest tests
68
+ run : pnpm run test
69
+
70
+ test-playwright :
71
+ name : Playwright tests
72
+ if : github.repository == 'apollographql/graphql-testing-library'
73
+ runs-on : ubuntu-latest
74
+ steps :
75
+ - name : Checkout repo
76
+ uses : actions/checkout@v4
77
+
78
+ - name : Install pnpm
79
+ uses : pnpm/action-setup@v4
80
+ with :
81
+ version : 9
82
+ run_install : false
83
+
84
+ - name : Install Node.js
85
+ uses : actions/setup-node@v4
86
+ with :
87
+ node-version : 20
88
+ cache : ' pnpm'
89
+
90
+ - name : Install dependencies
91
+ run : pnpm install
92
+
93
+ - name : Get installed Playwright version
94
+ id : playwright-version
95
+ run : echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
96
+
97
+ - name : Cache Playwright binaries
98
+ uses : actions/cache@v3
99
+ id : playwright-cache
100
+ with :
101
+ path : |
102
+ ~/.cache/ms-playwright
103
+ key : ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
104
+
105
+ - run : npx playwright install --with-deps
106
+ if : steps.playwright-cache.outputs.cache-hit != 'true'
107
+
108
+ - name : Serve Storybook and run tests
109
+ run : pnpm run build-and-test-storybook
110
+
111
+ lint :
112
+ name : Lint
113
+ if : github.repository == 'apollographql/graphql-testing-library'
114
+ runs-on : ubuntu-latest
115
+ steps :
116
+ - name : Checkout repo
117
+ uses : actions/checkout@v4
118
+
119
+ - name : Install pnpm
120
+ uses : pnpm/action-setup@v4
121
+ with :
122
+ version : 9
123
+ run_install : false
124
+
125
+ - name : Install Node.js
126
+ uses : actions/setup-node@v4
127
+ with :
128
+ node-version : 20
129
+ cache : ' pnpm'
130
+
131
+ - name : Install dependencies
132
+ run : pnpm install
133
+
134
+ - name : Lint
135
+ run : pnpm run lint
136
+
137
+ type-check :
138
+ name : Check types
139
+ if : github.repository == 'apollographql/graphql-testing-library'
140
+ runs-on : ubuntu-latest
141
+ steps :
142
+ - name : Checkout repo
143
+ uses : actions/checkout@v4
144
+
145
+ - name : Install pnpm
146
+ uses : pnpm/action-setup@v4
147
+ with :
148
+ version : 9
149
+ run_install : false
150
+
151
+ - name : Install Node.js
152
+ uses : actions/setup-node@v4
153
+ with :
154
+ node-version : 20
155
+ cache : ' pnpm'
156
+
157
+ - name : Install dependencies
158
+ run : pnpm install
159
+
160
+ - name : Check types
161
+ run : pnpm run type-check
0 commit comments