fix(ci): support memind-ci-mac runner and stabilize acceptance HTTP server

The self-hosted macOS runner cannot run apt-get or install Linux-only Sharp
packages; gate CI on sqlite availability and platform-specific Sharp setup.
Also wait for ephemeral Express listen before fetch to avoid AUTH-08 flakes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-03 15:47:11 +08:00
parent 147734870b
commit 4ebe7c76aa
2 changed files with 30 additions and 12 deletions
+20 -11
View File
@@ -33,21 +33,30 @@ jobs:
- name: Install system test dependencies - name: Install system test dependencies
run: | run: |
apt-get update if command -v apt-get >/dev/null 2>&1; then
apt-get install --yes --no-install-recommends sqlite3 apt-get update
rm -rf /var/lib/apt/lists/* apt-get install --yes --no-install-recommends sqlite3
rm -rf /var/lib/apt/lists/*
elif command -v brew >/dev/null 2>&1; then
if ! command -v sqlite3 >/dev/null 2>&1; then
brew install sqlite
fi
fi
command -v sqlite3
- name: Install locked dependencies - name: Install locked dependencies
run: | run: |
npm ci --include=optional npm ci --include=optional
SHARP_ARM64_VERSION="$(node -p "require('./package-lock.json').packages['node_modules/@img/sharp-linux-arm64'].version")" if [[ "$(uname -s)" == "Linux" ]]; then
LIBVIPS_ARM64_VERSION="$(node -p "require('./package-lock.json').packages['node_modules/@img/sharp-libvips-linux-arm64'].version")" SHARP_ARM64_VERSION="$(node -p "require('./package-lock.json').packages['node_modules/@img/sharp-linux-arm64'].version")"
if [[ ! -d node_modules/@img/sharp-linux-arm64 || ! -d node_modules/@img/sharp-libvips-linux-arm64 ]]; then LIBVIPS_ARM64_VERSION="$(node -p "require('./package-lock.json').packages['node_modules/@img/sharp-libvips-linux-arm64'].version")"
npm install --no-save --package-lock=false \ if [[ ! -d node_modules/@img/sharp-linux-arm64 || ! -d node_modules/@img/sharp-libvips-linux-arm64 ]]; then
"@img/sharp-linux-arm64@${SHARP_ARM64_VERSION}" \ npm install --no-save --package-lock=false \
"@img/sharp-libvips-linux-arm64@${LIBVIPS_ARM64_VERSION}" "@img/sharp-linux-arm64@${SHARP_ARM64_VERSION}" \
else "@img/sharp-libvips-linux-arm64@${LIBVIPS_ARM64_VERSION}"
echo "Locked Sharp ARM64 optional packages are already installed" else
echo "Locked Sharp ARM64 optional packages are already installed"
fi
fi fi
node -e "import('sharp').then((sharp) => sharp.default({ create: { width: 1, height: 1, channels: 4, background: '#000' } }).png().toBuffer())" node -e "import('sharp').then((sharp) => sharp.default({ create: { width: 1, height: 1, channels: 4, background: '#000' } }).png().toBuffer())"
+10 -1
View File
@@ -98,8 +98,17 @@ function buildApp(workspaceRoot, pool = createPool('public')) {
return app; return app;
} }
async function request(app, method, url, { body, headers } = {}) { async function listenEphemeral(app) {
const server = app.listen(0); const server = app.listen(0);
await new Promise((resolve, reject) => {
server.once('listening', resolve);
server.once('error', reject);
});
return server;
}
async function request(app, method, url, { body, headers } = {}) {
const server = await listenEphemeral(app);
try { try {
const { port } = server.address(); const { port } = server.address();
const response = await fetch(`http://127.0.0.1:${port}${url}`, { const response = await fetch(`http://127.0.0.1:${port}${url}`, {