-
Notifications
You must be signed in to change notification settings - Fork 229
248 lines (235 loc) · 9.42 KB
/
shopify-cli.yml
File metadata and controls
248 lines (235 loc) · 9.42 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
name: PR
on:
pull_request:
merge_group:
concurrency:
group: shopify-cli-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DEBUG: '1'
SHOPIFY_CLI_ENV: development
SHOPIFY_CONFIG: debug
PNPM_VERSION: '10.11.1'
BUNDLE_WITHOUT: 'test:development'
SHOPIFY_FLAG_CLIENT_ID: ${{ secrets.SHOPIFY_FLAG_CLIENT_ID }}
GH_TOKEN: ${{ secrets.SHOPIFY_GH_READ_CONTENT_TOKEN }}
GH_TOKEN_SHOP: ${{ secrets.SHOP_GH_READ_CONTENT_TOKEN }}
DEFAULT_NODE_VERSION: '24.1.0'
jobs:
type-check:
name: 'Type check'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: Type check
run: pnpm nx run-many --all --skip-nx-cache --target=type-check --output-style=stream
lint:
name: 'Lint'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: Lint
run: pnpm nx run-many --all --skip-nx-cache --target=lint --output-style=stream
bundle:
name: 'Bundle'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: 'Build'
run: pnpm nx run-many --all --skip-nx-cache --target=build --output-style=stream
- name: 'Bundle'
run: pnpm nx run-many --all --skip-nx-cache --target=bundle --output-style=stream
knip:
name: 'Knip (unused code check)'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: Run knip
run: pnpm knip
graphql-schema:
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
name: 'Check graphql-codegen has been run'
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: Get schemas for codegen
run: pnpm graphql-codegen:get-graphql-schemas
- name: Run graphql-codegen
run: pnpm graphql-codegen
- name: Run git diff
run: git diff
- name: Fail if any changes were made
run: 'test -z "$(git status --porcelain)" || { echo -e "Run pnpm graphql-codegen when queries are changed, committing any fixes and generated files" ; exit 1; }'
oclif-checks:
name: 'Check OCLIF manifests & readme & docs'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: Build
run: pnpm build --output-style=stream
- name: Refresh manifests
run: pnpm refresh-manifests
- name: Check if there are changes
run: 'test -z "$(git status --porcelain "**/oclif.manifest.json" )" || { echo -e "Run pnpm refresh-manifests before pushing new commands or flags. Diff here:\n\n$(git diff)" ; exit 1; }'
- name: Refresh readme
run: pnpm refresh-readme
- name: Check if there are changes
run: 'test -z "$(git status --porcelain "packages/cli/README.md" )" || { echo -e "Run pnpm refresh-readme before pushing new commands or flags. Diff here:\n\n$(git diff)" ; exit 1; }'
- name: Refresh code documentation
run: pnpm refresh-code-documentation
- name: Check if there are changes
run: 'test -z "$(git status --porcelain)" || { echo -e "Run pnpm refresh-code-documentation when you update functions with autogenerated examples. Diff here:\n\n$(git diff)" ; exit 1; }'
- name: Build shopify.dev docs
run: pnpm build-dev-docs
- name: Check if there are changes
run: 'test -z "$(git status --porcelain "docs-shopify.dev/generated/*.json" )" || { echo -e "Run (pnpm build-dev-docs) before pushing new commands or flags." ; exit 1; }'
unit-tests:
name: 'Unit tests with Node ${{ matrix.node }} in ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
node: [ '20.14.0', '22.2.0', '24.1.0' ]
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ matrix.node }}
- name: Unit tests
run: pnpm vitest run
env:
VITEST_MIN_THREADS: "1"
VITEST_MAX_THREADS: "4"
acceptance-tests:
name: 'Acceptance tests with Node ${{ matrix.node }} in ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
node: [ '24.1.0' ]
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ matrix.node }}
- name: Acceptance tests
env:
SHOPIFY_CLI_PARTNERS_TOKEN: ${{ secrets.SHOPIFY_CLI_PARTNERS_TOKEN }}
run: pnpm test:features --output-style=stream
test-coverage:
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
name: 'Test Coverage'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: Build
run: pnpm nx run-many --all --skip-nx-cache --target=build --output-style=stream
- name: Run and save test coverage
uses: ./.github/actions/run-and-save-test-coverage
with:
branch-name: '${{ github.head_ref }}'
- name: Download and publish test coverage
uses: ./.github/actions/download-and-publish-test-coverage
with:
base-branch-name: '${{ github.base_ref }}'
type-diff:
if: github.event.pull_request.head.repo.full_name == github.repository
name: 'Type-diff'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
name: Checkout [main]
with:
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: Build
run: pnpm nx run-many --all --skip-nx-cache --target=build --exclude=features --output-style=stream
- name: Type-diff
working-directory: workspace
id: type-diff
run: pnpm nx run type-diff
- uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # pin@v2.3.1
if: steps.type-diff.outputs.report != ''
with:
header: Type-diff
message: ${{ steps.type-diff.outputs.report }}
recreate: true