Skip to content

Commit da55596

Browse files
committed
vibe code
1 parent a8be391 commit da55596

2 files changed

Lines changed: 102 additions & 40 deletions

File tree

.github/workflows/chromium-headful-image.yaml

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,68 @@
11
name: chromium-headful-image
22

33
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
47
workflow_call:
58

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
613
jobs:
714
docker:
8-
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- arch: amd64
20+
runner: ubuntu-latest
21+
- arch: arm64
22+
runner: ubuntu-24.04-arm64
23+
runs-on: ${{ matrix.runner }}
924
permissions:
1025
contents: read
26+
env:
27+
UKC_TOKEN: dummy
28+
UKC_METRO: ci
29+
NAME: ci-chromium-headful
30+
DETACH: "true"
31+
SERVICE_EXCEPTIONS: pulseaudio
1132
steps:
1233
- name: Checkout
1334
uses: actions/checkout@v4
1435

15-
- name: Compute short SHA
16-
id: vars
36+
- name: Build image
1737
shell: bash
18-
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
38+
run: |
39+
bash images/chromium-headful/build-docker.sh
1940
20-
- name: Login to Docker Hub
21-
uses: docker/login-action@v3
22-
with:
23-
username: ${{ vars.DOCKERHUB_USERNAME }}
24-
password: ${{ secrets.DOCKERHUB_TOKEN }}
41+
- name: Run container
42+
shell: bash
43+
run: |
44+
bash images/chromium-headful/run-docker.sh
2545
26-
- name: Set up Docker Buildx
27-
uses: docker/setup-buildx-action@v3
46+
- name: Wait for supervisor services (allow pulseaudio non-RUNNING)
47+
shell: bash
48+
run: |
49+
trap "docker stop ci-chromium-headful >/dev/null 2>&1 || true" EXIT
50+
attempts=30
51+
sleep_seconds=1
52+
for i in $(seq 1 "$attempts"); do
53+
out=$(docker exec ci-chromium-headful supervisorctl status || true)
54+
echo "$out"
55+
total=$(echo "$out" | grep -v '^$' | wc -l | tr -d ' ')
56+
exceptions="${SERVICE_EXCEPTIONS:-}"
57+
pattern=$(printf '%s' "$exceptions" | tr ', ' '\n' | sed '/^$/d' | paste -sd '|' -)
58+
ok=$(echo "$out" | awk -v pat="$pattern" 'BEGIN{IGNORECASE=1} { if (pat != "" && $0 ~ pat) print; else if ($0 ~ /RUNNING/) print }' | wc -l | tr -d ' ')
59+
if [ "$total" -gt 0 ] && [ "$ok" -eq "$total" ]; then
60+
echo "All required services are RUNNING"
61+
exit 0
62+
fi
63+
sleep "$sleep_seconds"
64+
done
65+
echo "Supervisor services not ready in time"
66+
docker logs --tail=200 ci-chromium-headful || true
67+
exit 1
2868
29-
- name: Build and push
30-
uses: docker/build-push-action@v6
31-
with:
32-
context: .
33-
file: images/chromium-headful/Dockerfile
34-
push: true
35-
tags: onkernel/chromium-headful:${{ steps.vars.outputs.short_sha }}
36-
cache-from: type=gha
37-
cache-to: type=gha,mode=max

.github/workflows/chromium-headless-image.yaml

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,68 @@
11
name: chromium-headless-image
22

33
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
47
workflow_call:
58

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
613
jobs:
714
docker:
8-
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- arch: amd64
20+
runner: ubuntu-latest
21+
- arch: arm64
22+
runner: ubuntu-24.04-arm64
23+
runs-on: ${{ matrix.runner }}
924
permissions:
1025
contents: read
26+
env:
27+
UKC_TOKEN: dummy
28+
UKC_METRO: ci
29+
NAME: ci-chromium-headless
30+
DETACH: "true"
31+
SERVICE_EXCEPTIONS: pulseaudio
1132
steps:
1233
- name: Checkout
1334
uses: actions/checkout@v4
1435

15-
- name: Compute short SHA
16-
id: vars
36+
- name: Build image
1737
shell: bash
18-
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
38+
run: |
39+
bash images/chromium-headless/build-docker.sh
1940
20-
- name: Login to Docker Hub
21-
uses: docker/login-action@v3
22-
with:
23-
username: ${{ vars.DOCKERHUB_USERNAME }}
24-
password: ${{ secrets.DOCKERHUB_TOKEN }}
41+
- name: Run container
42+
shell: bash
43+
run: |
44+
bash images/chromium-headless/run-docker.sh
2545
26-
- name: Set up Docker Buildx
27-
uses: docker/setup-buildx-action@v3
46+
- name: Wait for supervisor services (allow pulseaudio non-RUNNING)
47+
shell: bash
48+
run: |
49+
trap "docker stop ci-chromium-headless >/dev/null 2>&1 || true" EXIT
50+
attempts=30
51+
sleep_seconds=1
52+
for i in $(seq 1 "$attempts"); do
53+
out=$(docker exec ci-chromium-headless supervisorctl status || true)
54+
echo "$out"
55+
total=$(echo "$out" | grep -v '^$' | wc -l | tr -d ' ')
56+
exceptions="${SERVICE_EXCEPTIONS:-}"
57+
pattern=$(printf '%s' "$exceptions" | tr ', ' '\n' | sed '/^$/d' | paste -sd '|' -)
58+
ok=$(echo "$out" | awk -v pat="$pattern" 'BEGIN{IGNORECASE=1} { if (pat != "" && $0 ~ pat) print; else if ($0 ~ /RUNNING/) print }' | wc -l | tr -d ' ')
59+
if [ "$total" -gt 0 ] && [ "$ok" -eq "$total" ]; then
60+
echo "All required services are RUNNING"
61+
exit 0
62+
fi
63+
sleep "$sleep_seconds"
64+
done
65+
echo "Supervisor services not ready in time"
66+
docker logs --tail=200 ci-chromium-headless || true
67+
exit 1
2868
29-
- name: Build and push
30-
uses: docker/build-push-action@v6
31-
with:
32-
context: .
33-
file: images/chromium-headless/image/Dockerfile
34-
push: true
35-
tags: onkernel/chromium-headless:${{ steps.vars.outputs.short_sha }}
36-
cache-from: type=gha
37-
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)