Files
memind/.gitea/workflows/ci.yml
T
john 4ebe7c76aa 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>
2026-08-03 15:47:11 +08:00

86 lines
2.7 KiB
YAML

name: Memind CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: memind-ci-${{ gitea.ref }}
cancel-in-progress: true
jobs:
verify:
name: Test, build, and release guards
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out exact commit
run: |
git init .
git remote add origin https://git.tkmind.cn/tkmind/memind.git
git fetch --depth=2 origin "${{ gitea.sha }}"
git checkout --detach FETCH_HEAD
test "$(git rev-parse HEAD)" = "${{ gitea.sha }}"
- name: Install system test dependencies
run: |
if command -v apt-get >/dev/null 2>&1; then
apt-get update
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
run: |
npm ci --include=optional
if [[ "$(uname -s)" == "Linux" ]]; then
SHARP_ARM64_VERSION="$(node -p "require('./package-lock.json').packages['node_modules/@img/sharp-linux-arm64'].version")"
LIBVIPS_ARM64_VERSION="$(node -p "require('./package-lock.json').packages['node_modules/@img/sharp-libvips-linux-arm64'].version")"
if [[ ! -d node_modules/@img/sharp-linux-arm64 || ! -d node_modules/@img/sharp-libvips-linux-arm64 ]]; then
npm install --no-save --package-lock=false \
"@img/sharp-linux-arm64@${SHARP_ARM64_VERSION}" \
"@img/sharp-libvips-linux-arm64@${LIBVIPS_ARM64_VERSION}"
else
echo "Locked Sharp ARM64 optional packages are already installed"
fi
fi
node -e "import('sharp').then((sharp) => sharp.default({ create: { width: 1, height: 1, channels: 4, background: '#000' } }).png().toBuffer())"
- name: Check patch formatting
run: git diff --check HEAD^
- name: Run full test suite
run: npm test
- name: Verify release gate and canary routing
run: npm run test:release-gate:unit
- name: Build production frontend
run: npm run build
- name: Verify MindSpace publish guards
run: npm run verify:mindspace-publish-guards
- name: Verify MindSpace page sync guards
run: npm run verify:mindspace-page-sync-guards
- name: Verify Page Data delivery
run: npm run verify:page-data
- name: Check published download links
run: npm run check:mindspace-public-links