-
Notifications
You must be signed in to change notification settings - Fork 117
311 lines (311 loc) · 10.1 KB
/
pr.yml
File metadata and controls
311 lines (311 loc) · 10.1 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
name: CI
on: pull_request
env:
NODE_OPTIONS: "--disable-proto=delete"
concurrency:
# Ensure single build of a pull request
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
review:
name: "Review"
permissions:
issues: write # comment on PRs (suggestion-bot)
pull-requests: write # create code reviews (suggestion-bot)
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup the toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@4.4.10
with:
node-version: 24
- name: Deduplicate packages
run: |
yarn dedupe --check
- name: Install npm dependencies
run: |
yarn
- name: Ensure rnx-kit packages come from our repository
run: |
node --no-warnings --conditions=typescript incubator/lint-lockfile/src/index.ts
- name: Check for change files
if: ${{ github.actor != 'microsoft-react-native-sdk[bot]' || github.head_ref != 'changeset-release/main' }}
run: |
yarn change:check --since origin/${{ github.base_ref }}
- name: Report formatting problems
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn format
if [[ -n "$GITHUB_TOKEN" ]]; then
git diff | yarn suggestion-bot
fi
git diff --exit-code
- name: Report package metadata inconsistencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn constraints --fix
if [[ -n "$GITHUB_TOKEN" ]]; then
git diff | yarn suggestion-bot
fi
git diff --exit-code
- name: Report dependency misalignments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn rnx-align-deps --write
if [[ -n "$GITHUB_TOKEN" ]]; then
git diff | yarn suggestion-bot
fi
git diff --exit-code
- name: Report unused dependencies
run: |
yarn knip
- name: Ensure READMEs are up-to-date
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn update-readme
if [[ -n "$GITHUB_TOKEN" ]]; then
git diff | yarn suggestion-bot
fi
git diff --exit-code
- name: Report @rnx-kit/build workflow inconsistencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cp incubator/build/workflows/github.yml .github/workflows/rnx-build.yml
if [[ -n "$GITHUB_TOKEN" ]]; then
git diff | yarn suggestion-bot
fi
git diff --exit-code
timeout-minutes: 60
build:
name: "Build"
permissions: {}
strategy:
matrix:
node-version: [22, 24]
os: [ubuntu-24.04, windows-2025]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Setup the toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@4.4.10
with:
node-version: ${{ matrix.node-version }}
- name: Install package dependencies
run: |
yarn
- name: Build and test packages
run: |
yarn build:ci --base origin/${{ github.base_ref }}
- name: Bundle packages
run: |
yarn bundle:ci --base origin/${{ github.base_ref }}
- name: Bundle test apps with esbuild
run: |
yarn nx affected --base origin/${{ github.base_ref }} --target bundle+esbuild
shell: bash
timeout-minutes: 60
build-android-test-app:
name: "Build Android"
permissions: {}
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Setup the toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@4.4.10
with:
platform: android
- name: Install package dependencies
run: |
yarn
- name: Determine whether the Android app needs to be built
id: affected-projects
run: |
if [[ "$(yarn show-affected --base origin/${{ github.base_ref }})" = *"@rnx-kit/test-app"* ]]; then
echo 'android=true' >> $GITHUB_OUTPUT
fi
- name: Build @rnx-kit/cli
if: ${{ steps.affected-projects.outputs.android != '' }}
run: |
yarn nx build @rnx-kit/cli
- name: Build Android app
if: ${{ steps.affected-projects.outputs.android != '' }}
run: |
yarn build:android
working-directory: packages/test-app
timeout-minutes: 60
build-ios-test-app:
name: "Build iOS"
permissions: {}
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Setup the toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@4.4.10
with:
platform: ios
xcode-developer-dir: /Applications/Xcode_16.4.app
- name: Install package dependencies
run: |
yarn
- name: Determine whether the iOS app needs to be built
id: affected-projects
run: |
if [[ "$(yarn show-affected --base origin/${{ github.base_ref }})" = *"@rnx-kit/test-app"* ]]; then
echo 'ios=true' >> $GITHUB_OUTPUT
fi
- name: Build @rnx-kit/cli
if: ${{ steps.affected-projects.outputs.ios != '' }}
run: |
yarn nx build @rnx-kit/cli
- name: Install Pods
uses: microsoft/react-native-test-app/.github/actions/cocoapods@trunk
if: ${{ steps.affected-projects.outputs.ios != '' }}
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
RCT_USE_PREBUILT_RNCORE: 1
RCT_USE_RN_DEP: 1
with:
project-directory: ios
working-directory: packages/test-app
- name: Build iOS app
if: ${{ steps.affected-projects.outputs.ios != '' }}
run: |
yarn build:ios | xcbeautify
working-directory: packages/test-app
timeout-minutes: 60
build-macos-test-app:
name: "Build macOS"
permissions: {}
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Setup the toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@4.4.10
with:
platform: macos
xcode-developer-dir: /Applications/Xcode_16.4.app
- name: Install package dependencies
run: |
yarn
- name: Determine whether the macOS app needs to be built
id: affected-projects
run: |
if [[ "$(yarn show-affected --base origin/${{ github.base_ref }})" = *"@rnx-kit/test-app-macos"* ]]; then
echo 'macos=true' >> $GITHUB_OUTPUT
fi
- name: Build @rnx-kit/cli
if: ${{ steps.affected-projects.outputs.macos != '' }}
run: |
yarn nx build @rnx-kit/cli
- name: Install Pods
uses: microsoft/react-native-test-app/.github/actions/cocoapods@trunk
if: ${{ steps.affected-projects.outputs.macos != '' }}
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
RCT_USE_PREBUILT_RNCORE: 1
RCT_USE_RN_DEP: 1
with:
project-directory: macos
working-directory: packages/test-app-macos
- name: Build macOS app
if: ${{ steps.affected-projects.outputs.macos != '' }}
run: |
yarn build:native | xcbeautify
working-directory: packages/test-app-macos
timeout-minutes: 60
build-windows-test-app:
name: "Build Windows"
permissions: {}
runs-on: windows-2025
steps:
- name: Checkout
uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Setup the toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@4.4.10
with:
platform: windows
- name: Install package dependencies
run: |
yarn
- name: Determine whether the Windows app needs to be built
id: affected-projects
run: |
if [[ "$(yarn show-affected --base origin/${{ github.base_ref }})" = *"@rnx-kit/test-app-windows"* ]]; then
echo 'windows=true' >> $GITHUB_OUTPUT
fi
shell: bash
- name: Build @rnx-kit/cli
if: ${{ steps.affected-projects.outputs.windows != '' }}
run: |
yarn nx build @rnx-kit/cli
- name: Generate Visual Studio solution
if: ${{ steps.affected-projects.outputs.windows != '' }}
run: |
yarn install-windows-test-app --use-nuget --msbuildprops WindowsTargetPlatformVersion=10.0.26100.0
working-directory: packages/test-app-windows
- name: Build Windows app
if: ${{ steps.affected-projects.outputs.windows != '' }}
run: |
yarn build:native
working-directory: packages/test-app-windows
timeout-minutes: 60
build-website:
name: "Build the website"
permissions: {}
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup the toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@4.4.10
with:
cache-npm-dependencies: ""
- name: Install package dependencies (docsite)
run: |
yarn
working-directory: docsite
- name: Build website
run: |
yarn build
working-directory: docsite
timeout-minutes: 60
label:
name: "Label"
permissions:
contents: read
pull-requests: write
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
continue-on-error: true