Skip to content

Commit e178455

Browse files
authored
ci: check for clean git state in npm validation (microsoft#230479)
1 parent ad047e2 commit e178455

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

build/azure-pipelines/product-npm-package-validate.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,27 @@ jobs:
6868
fi
6969
7070
echo "Attempt $attempt: Running npm ci"
71-
if npm ci --ignore-scripts; then
72-
echo "npm ci succeeded on attempt $attempt"
73-
exit 0
71+
if npm i --ignore-scripts; then
72+
if node build/npm/postinstall.js; then
73+
echo "npm i succeeded on attempt $attempt"
74+
exit 0
75+
else
76+
echo "node build/npm/postinstall.js failed on attempt $attempt"
77+
fi
7478
else
75-
echo "npm ci failed on attempt $attempt"
79+
echo "npm i failed on attempt $attempt"
7680
fi
7781
done
7882
79-
echo "npm ci failed after 6 attempts"
83+
echo "npm i failed after 6 attempts"
8084
exit 1
8185
env:
86+
npm_command: 'install --ignore-scripts'
8287
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
8388
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
8489
GITHUB_TOKEN: "$(github-distro-mixin-password)"
8590
displayName: Install dependencies with retries
8691
timeoutInMinutes: 400
92+
93+
- script: .github/workflows/check-clean-git-state.sh
94+
displayName: Check clean git state

build/npm/postinstall.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function npmInstall(dir, opts) {
6060
run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${path.resolve(root, dir)}`], opts);
6161
} else {
6262
log(dir, 'Installing dependencies...');
63-
run(npm, [command], opts);
63+
run(npm, command.split(' '), opts);
6464
}
6565
}
6666

test/monaco/.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
legacy-peer-deps="true"
2+
timeout=180000

0 commit comments

Comments
 (0)