Skip to content

Commit 5d85ec8

Browse files
Saadnajmiclaude
andcommitted
ci: re-enable react-native-macos-init integration test without Verdaccio
Replace the Verdaccio-based integration test with a simpler approach that installs the local react-native-macos package directly via npm install <path>. This avoids the Verdaccio hang issue (#2344) while still testing the full init flow end-to-end: project creation, template application, pod install, and macOS build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5ffa084 commit 5d85ec8

2 files changed

Lines changed: 23 additions & 33 deletions

File tree

.github/workflows/microsoft-pr.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,11 @@ jobs:
132132
permissions: {}
133133
uses: ./.github/workflows/microsoft-build-rntester.yml
134134

135-
# https://github.com/microsoft/react-native-macos/issues/2344
136-
# Disable these tests because verdaccio hangs
137-
# test-react-native-macos-init:
138-
# name: "Test react-native-macos init"
139-
# permissions: {}
140-
# if: ${{ endsWith(github.base_ref, '-stable') }}
141-
# uses: ./.github/workflows/microsoft-test-react-native-macos-init.yml
135+
test-react-native-macos-init:
136+
name: "Test react-native-macos init"
137+
permissions: {}
138+
if: ${{ endsWith(github.base_ref, '-stable') }}
139+
uses: ./.github/workflows/microsoft-test-react-native-macos-init.yml
142140

143141
# https://github.com/microsoft/react-native-macos/issues/2344
144142
# Disable these tests because verdaccio hangs
@@ -158,7 +156,7 @@ jobs:
158156
- yarn-constraints
159157
- javascript-tests
160158
- build-rntester
161-
# - test-react-native-macos-init
159+
- test-react-native-macos-init
162160
# - react-native-test-app-integration
163161
steps:
164162
- name: All required jobs passed

.github/workflows/microsoft-test-react-native-macos-init.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,21 @@ jobs:
3232
working-directory: packages/react-native-macos-init
3333
run: yarn build
3434

35-
- name: Start Verdaccio server
35+
- name: Determine React Native version
36+
id: rn-version
3637
run: |
37-
set -euo pipefail
38-
nohup npx --yes verdaccio --config .ado/verdaccio/config.yaml >/dev/null 2>&1 &
39-
echo $! > $RUNNER_TEMP/verdaccio.pid
40-
- name: Wait for Verdaccio to be ready
41-
run: node .ado/scripts/waitForVerdaccio.mjs http://localhost:4873
42-
43-
- name: Configure npm for Verdaccio
44-
run: .ado/scripts/verdaccio.sh init
45-
46-
- name: Publish to Verdaccio
47-
run: .ado/scripts/verdaccio.sh publish --branch origin/${{ github.base_ref }}
48-
49-
- name: Export versions
50-
run: node .ado/scripts/export-versions.mjs
38+
RN_VERSION=$(node -e "
39+
const pkg = require('./packages/react-native/package.json');
40+
const codegen = pkg.dependencies['@react-native/codegen'];
41+
const [major, minor] = codegen.split('-')[0].split('.');
42+
console.log(major + '.' + minor);
43+
")
44+
echo "version=$RN_VERSION" >> "$GITHUB_OUTPUT"
5145
5246
- name: Initialize new project
5347
run: |
5448
set -eox pipefail
55-
npx --yes @react-native-community/cli init testcli --version $(cat .react_native_version) --skip-install
49+
npx --yes @react-native-community/cli init testcli --version ${{ steps.rn-version.outputs.version }} --skip-install
5650
working-directory: ${{ runner.temp }}
5751

5852
- name: Install dependencies in new project
@@ -62,23 +56,21 @@ jobs:
6256
yarn install --mode=update-lockfile
6357
yarn install
6458
59+
- name: Install local react-native-macos
60+
working-directory: ${{ runner.temp }}/testcli
61+
run: |
62+
set -eox pipefail
63+
npm install --save --legacy-peer-deps ${{ github.workspace }}/packages/react-native
64+
6565
- name: Apply macOS template
6666
working-directory: ${{ runner.temp }}/testcli
6767
run: |
6868
set -eox pipefail
69-
${{ github.workspace }}/.ado/scripts/verdaccio.sh configure
70-
node ${{ github.workspace }}/packages/react-native-macos-init/bin.js --verbose --version latest --overwrite --prerelease
69+
node ${{ github.workspace }}/packages/react-native-macos-init/bin.js --verbose --overwrite --prerelease
7170
pod install --project-directory=macos
7271
7372
- name: Build macOS app
7473
working-directory: ${{ runner.temp }}/testcli
7574
run: |
7675
set -eox pipefail
7776
npx react-native build-macos
78-
79-
- name: Stop Verdaccio
80-
if: always()
81-
run: |
82-
if [ -f "$RUNNER_TEMP/verdaccio.pid" ]; then
83-
kill "$(cat $RUNNER_TEMP/verdaccio.pid)" || true
84-
fi

0 commit comments

Comments
 (0)