Skip to content

Commit ac862f5

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 c991e88 commit ac862f5

2 files changed

Lines changed: 17 additions & 36 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: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,53 +32,36 @@ 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+
console.log(pkg.peerDependencies['react-native']);
41+
")
42+
echo "version=$RN_VERSION" >> "$GITHUB_OUTPUT"
5143
5244
- name: Initialize new project
5345
run: |
5446
set -eox pipefail
55-
npx --yes @react-native-community/cli init testcli --version $(cat .react_native_version) --skip-install
47+
npx --yes @react-native-community/cli init testcli --version ${{ steps.rn-version.outputs.version }}
5648
working-directory: ${{ runner.temp }}
5749

58-
- name: Install dependencies in new project
50+
- name: Install local react-native-macos
5951
working-directory: ${{ runner.temp }}/testcli
6052
run: |
6153
set -eox pipefail
62-
yarn install --mode=update-lockfile
63-
yarn install
54+
npm install ${{ github.workspace }}/packages/react-native
6455
6556
- name: Apply macOS template
6657
working-directory: ${{ runner.temp }}/testcli
6758
run: |
6859
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
60+
node ${{ github.workspace }}/packages/react-native-macos-init/bin.js --verbose --overwrite --prerelease
7161
pod install --project-directory=macos
7262
7363
- name: Build macOS app
7464
working-directory: ${{ runner.temp }}/testcli
7565
run: |
7666
set -eox pipefail
7767
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)