Files
qinglong/.github/workflows/dev-multiarch-acceptance.yml

117 lines
5.9 KiB
YAML

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: 1
matrix:
include:
- { slug: develop-amd64, channel: develop, platform: linux/amd64, digest: 'sha256:1dbee7a5228cd854c14e3d726cdff501c2dec09f96fc32070331faee8953b11c' }
- { slug: develop-armv6, channel: develop, platform: linux/arm/v6, digest: 'sha256:1dbee7a5228cd854c14e3d726cdff501c2dec09f96fc32070331faee8953b11c' }
- { slug: develop-armv7, channel: develop, platform: linux/arm/v7, digest: 'sha256:1dbee7a5228cd854c14e3d726cdff501c2dec09f96fc32070331faee8953b11c' }
- { slug: develop-arm64, channel: develop, platform: linux/arm64, digest: 'sha256:1dbee7a5228cd854c14e3d726cdff501c2dec09f96fc32070331faee8953b11c' }
- { slug: develop-ppc64le, channel: develop, platform: linux/ppc64le, digest: 'sha256:1dbee7a5228cd854c14e3d726cdff501c2dec09f96fc32070331faee8953b11c' }
- { slug: develop-s390x, channel: develop, platform: linux/s390x, digest: 'sha256:1dbee7a5228cd854c14e3d726cdff501c2dec09f96fc32070331faee8953b11c' }
- { slug: develop-386, channel: develop, platform: linux/386, digest: 'sha256:1dbee7a5228cd854c14e3d726cdff501c2dec09f96fc32070331faee8953b11c' }
- { slug: debian-dev-amd64, channel: debian-dev, platform: linux/amd64, digest: 'sha256:e3d2f52b8d8f06e4d4a58994ec2af2081d415601bc2076bb7eae23a5bee69f6a' }
- { slug: debian-dev-arm64, channel: debian-dev, platform: linux/arm64, digest: 'sha256:e3d2f52b8d8f06e4d4a58994ec2af2081d415601bc2076bb7eae23a5bee69f6a' }
- { slug: debian-dev-ppc64le, channel: debian-dev, platform: linux/ppc64le, digest: 'sha256:e3d2f52b8d8f06e4d4a58994ec2af2081d415601bc2076bb7eae23a5bee69f6a' }
- { slug: debian-dev-s390x, channel: debian-dev, platform: linux/s390x, digest: 'sha256:e3d2f52b8d8f06e4d4a58994ec2af2081d415601bc2076bb7eae23a5bee69f6a' }
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
if ! command -v google-chrome && ! command -v chromium && ! command -v chromium-browser; then
node "$RUNNER_TEMP/browser/node_modules/playwright-core/cli.js" install --with-deps chromium
fi
- 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}" "$RUNNER_TEMP/qinglong-data-${SLUG}"
docker pull --platform "$PLATFORM" "$image"
docker image inspect "$image" > "evidence/${SLUG}/image-inspect.json"
qemu_env=()
if [ "$PLATFORM" = linux/arm/v6 ]; then qemu_env=(--env QEMU_CPU=arm1176); fi
docker run --detach --name qinglong-acceptance --platform "$PLATFORM" "${qemu_env[@]}" \
--add-host=host.docker.internal:host-gateway \
--publish 127.0.0.1:5700:5700 \
--volume "$RUNNER_TEMP/qinglong-data-${SLUG}:/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 || true)"
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