mirror of
https://github.com/whyour/qinglong.git
synced 2026-11-17 06:54:28 +08:00
test: add isolated dev multiarch acceptance harness
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
name: Dev multiarch acceptance
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- codex/dev-multiarch-acceptance-2efc5e4
|
||||
paths:
|
||||
- '.github/workflows/dev-multiarch-acceptance.yml'
|
||||
- '.github/scripts/multiarch-acceptance.cjs'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
image-main-flows:
|
||||
runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
|
||||
timeout-minutes: 65
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
include:
|
||||
- { slug: develop-amd64, channel: develop, platform: linux/amd64, digest: 'sha256:1dbee7a5228cd854c14e3d726cdff501c2dec09f96fc32070331faee8953b11c' }
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '24'
|
||||
- uses: docker/setup-qemu-action@v4
|
||||
if: ${{ matrix.platform != 'linux/amd64' && matrix.platform != 'linux/arm64' }}
|
||||
with:
|
||||
cache-image: false
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: qinglong-cli-2efc5e45037662aaf898cd7f8db68421df0908b2
|
||||
run-id: '40349395090'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
path: cli-package
|
||||
- name: Prepare CLI and browser
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p "$RUNNER_TEMP/cli"
|
||||
tar -xzf cli-package/whyour-qinglong-cli-0.1.3.tgz -C "$RUNNER_TEMP/cli"
|
||||
test -f "$RUNNER_TEMP/cli/package/dist/npm/ql.js"
|
||||
npm install --no-save --prefix "$RUNNER_TEMP/browser" playwright-core@1.55.0
|
||||
command -v google-chrome || command -v chromium || command -v chromium-browser
|
||||
- name: Pull and start exact platform image
|
||||
shell: bash
|
||||
env:
|
||||
IMAGE_DIGEST: ${{ matrix.digest }}
|
||||
PLATFORM: ${{ matrix.platform }}
|
||||
SLUG: ${{ matrix.slug }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
image="whyour/qinglong@${IMAGE_DIGEST}"
|
||||
mkdir -p "evidence/${SLUG}/data"
|
||||
docker pull --platform "$PLATFORM" "$image"
|
||||
docker image inspect "$image" > "evidence/${SLUG}/image-inspect.json"
|
||||
docker run --detach --name qinglong-acceptance --platform "$PLATFORM" \
|
||||
--add-host=host.docker.internal:host-gateway \
|
||||
--publish 127.0.0.1:5700:5700 \
|
||||
--volume "$PWD/evidence/${SLUG}/data:/ql/data" \
|
||||
"$image"
|
||||
for attempt in $(seq 1 120); do
|
||||
if curl --fail --silent http://127.0.0.1:5700/api/health > "evidence/${SLUG}/health.json"; then exit 0; fi
|
||||
sleep 5
|
||||
done
|
||||
docker logs qinglong-acceptance > "evidence/${SLUG}/startup.log" 2>&1 || true
|
||||
exit 1
|
||||
- name: Exercise all module main flows and capture UI
|
||||
shell: bash
|
||||
env:
|
||||
QL_URL: http://127.0.0.1:5700
|
||||
QL_ARCH_SLUG: ${{ matrix.slug }}
|
||||
QL_PLATFORM: ${{ matrix.platform }}
|
||||
QL_IMAGE: ${{ matrix.channel }}@${{ matrix.digest }}
|
||||
QL_OUTPUT: evidence/${{ matrix.slug }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export QL_CLI="$RUNNER_TEMP/cli/package/dist/npm/ql.js"
|
||||
export PLAYWRIGHT_CORE="$RUNNER_TEMP/browser/node_modules/playwright-core"
|
||||
export CHROME_BIN="$(command -v google-chrome || command -v chromium || command -v chromium-browser)"
|
||||
node .github/scripts/multiarch-acceptance.cjs 2>&1 | tee "evidence/${QL_ARCH_SLUG}/acceptance.log"
|
||||
- name: Save container logs
|
||||
if: always()
|
||||
shell: bash
|
||||
env:
|
||||
SLUG: ${{ matrix.slug }}
|
||||
run: |
|
||||
mkdir -p "evidence/${SLUG}"
|
||||
docker logs qinglong-acceptance > "evidence/${SLUG}/container.log" 2>&1 || true
|
||||
docker inspect qinglong-acceptance > "evidence/${SLUG}/container-inspect.json" 2>&1 || true
|
||||
docker rm --force qinglong-acceptance || true
|
||||
- uses: actions/upload-artifact@v6
|
||||
if: always()
|
||||
with:
|
||||
name: dev-multiarch-${{ matrix.slug }}
|
||||
path: evidence/${{ matrix.slug }}/
|
||||
if-no-files-found: warn
|
||||
Reference in New Issue
Block a user