Update tests #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: chromium-headful-image | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| workflow_call: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| docker: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm64 | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| env: | |
| UKC_TOKEN: dummy | |
| UKC_METRO: ci | |
| NAME: ci-chromium-headful | |
| DETACH: "true" | |
| SERVICE_EXCEPTIONS: pulseaudio | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build image | |
| shell: bash | |
| run: | | |
| bash images/chromium-headful/build-docker.sh | |
| - name: Run container | |
| shell: bash | |
| env: | |
| ENABLE_WEBRTC: true | |
| run: | | |
| bash images/chromium-headful/run-docker.sh | |
| - name: Wait for supervisor services (allow pulseaudio non-RUNNING) | |
| shell: bash | |
| run: | | |
| trap "docker stop ci-chromium-headful >/dev/null 2>&1 || true" EXIT | |
| attempts=30 | |
| sleep_seconds=1 | |
| for i in $(seq 1 "$attempts"); do | |
| out=$(docker exec ci-chromium-headful supervisorctl status || true) | |
| echo "$out" | |
| total=$(echo "$out" | grep -v '^$' | wc -l | tr -d ' ') | |
| exceptions="${SERVICE_EXCEPTIONS:-}" | |
| pattern=$(printf '%s' "$exceptions" | tr ', ' '\n' | sed '/^$/d' | paste -sd '|' -) | |
| ok=$(echo "$out" | awk -v pat="$pattern" 'BEGIN{IGNORECASE=1} { if (pat != "" && $0 ~ pat) print; else if ($0 ~ /RUNNING/) print }' | wc -l | tr -d ' ') | |
| if [ "$total" -gt 0 ] && [ "$ok" -eq "$total" ]; then | |
| echo "All required services are RUNNING" | |
| exit 0 | |
| fi | |
| sleep "$sleep_seconds" | |
| done | |
| echo "Supervisor services not ready in time" | |
| docker logs --tail=200 ci-chromium-headful || true | |
| exit 1 | |