Skip to content

Commit 04fdde4

Browse files
committed
feat(ci): add DLStreamer image build workflows
Add CI workflows and build scripts for DLStreamer images: - azl3-x86_64-dlstreamer - elxr12-x86_64-dlstreamer - emt3-x86_64-dlstreamer - ubuntu24-x86_64-dlstreamer Workflows trigger on push/PR to main and support manual dispatch with optional QEMU boot testing.
1 parent 23f4c62 commit 04fdde4

8 files changed

Lines changed: 1192 additions & 0 deletions
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Build AZL3 DLStreamer Image
2+
on:
3+
workflow_dispatch: # Manual runs
4+
inputs:
5+
ref:
6+
description: "Branch or SHA to test (e.g. feature/x or a1b2c3)"
7+
required: false
8+
run_qemu_test:
9+
description: "Run QEMU boot test after build"
10+
required: false
11+
default: "false"
12+
type: choice
13+
options:
14+
- "true"
15+
- "false"
16+
push:
17+
branches:
18+
- main
19+
pull_request:
20+
branches:
21+
- main
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
build-azl3-dlstreamer:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Install Earthly
39+
uses: earthly/actions-setup@v1
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
version: "latest"
43+
44+
- name: Install system deps
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y qemu-system-x86 ovmf tree jq systemd-ukify mmdebstrap systemd-boot
48+
49+
- name: Set up Go
50+
uses: actions/setup-go@v5
51+
with:
52+
go-version: stable
53+
54+
- name: Prepare build script
55+
run: |
56+
if [ ! -f scripts/build_azl3_dlstreamer.sh ]; then
57+
echo "scripts/build_azl3_dlstreamer.sh not found!"
58+
exit 1
59+
fi
60+
chmod +x scripts/build_azl3_dlstreamer.sh
61+
62+
- name: Run AZL3 DLStreamer Image Build
63+
env:
64+
RUN_QEMU_TEST: ${{ github.event.inputs.run_qemu_test }}
65+
run: |
66+
echo "Starting AZL3 DLStreamer image build..."
67+
# Ensure script has access to docker group for Earthly
68+
sudo usermod -aG docker $USER
69+
70+
# Prepare arguments with input validation
71+
ARGS=""
72+
case "${RUN_QEMU_TEST}" in
73+
"true")
74+
ARGS="--qemu-test"
75+
echo "QEMU boot test will be run after build"
76+
;;
77+
"false"|"")
78+
echo "QEMU boot test will be skipped"
79+
;;
80+
*)
81+
echo "Invalid input for run_qemu_test: ${RUN_QEMU_TEST}"
82+
exit 1
83+
;;
84+
esac
85+
86+
# Run the AZL3 DLStreamer image build script
87+
./scripts/build_azl3_dlstreamer.sh $ARGS
88+
echo "AZL3 DLStreamer image build completed."
89+
90+
- name: Notify on failure
91+
if: ${{ failure() && github.event_name == 'pull_request' }}
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
REVIEWER_ID: srmungar
95+
run: |
96+
PR_AUTHOR=$(jq --raw-output 'try .pull_request.user.login // empty' "$GITHUB_EVENT_PATH")
97+
if [ -z "$PR_AUTHOR" ]; then
98+
echo "PR_AUTHOR not found in event payload. Skipping notification."
99+
exit 0
100+
fi
101+
COMMENT_BODY="Hey @$PR_AUTHOR and @$REVIEWER_ID — the AZL3 DLStreamer image build has failed. Please check the logs."
102+
curl -s -X POST \
103+
-H "Authorization: Bearer $GITHUB_TOKEN" \
104+
-H "Accept: application/vnd.github.v3+json" \
105+
--data "{\"body\": \"$COMMENT_BODY\"}" \
106+
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Build ELXR12 DLStreamer Image
2+
on:
3+
workflow_dispatch: # Manual runs
4+
inputs:
5+
ref:
6+
description: "Branch or SHA to test (e.g. feature/x or a1b2c3)"
7+
required: false
8+
run_qemu_test:
9+
description: "Run QEMU boot test after build"
10+
required: false
11+
default: "false"
12+
type: choice
13+
options:
14+
- "true"
15+
- "false"
16+
push:
17+
branches:
18+
- main
19+
pull_request:
20+
branches:
21+
- main
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
build-elxr12-dlstreamer:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Install Earthly
39+
uses: earthly/actions-setup@v1
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
version: "latest"
43+
44+
- name: Install system deps
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y qemu-system-x86 ovmf tree jq systemd-ukify mmdebstrap systemd-boot
48+
49+
- name: Set up Go
50+
uses: actions/setup-go@v5
51+
with:
52+
go-version: stable
53+
54+
- name: Prepare build script
55+
run: |
56+
if [ ! -f scripts/build_elxr12_dlstreamer.sh ]; then
57+
echo "scripts/build_elxr12_dlstreamer.sh not found!"
58+
exit 1
59+
fi
60+
chmod +x scripts/build_elxr12_dlstreamer.sh
61+
62+
- name: Run ELXR12 DLStreamer Image Build
63+
env:
64+
RUN_QEMU_TEST: ${{ github.event.inputs.run_qemu_test }}
65+
run: |
66+
echo "Starting ELXR12 DLStreamer image build..."
67+
# Ensure script has access to docker group for Earthly
68+
sudo usermod -aG docker $USER
69+
70+
# Prepare arguments with input validation
71+
ARGS=""
72+
case "${RUN_QEMU_TEST}" in
73+
"true")
74+
ARGS="--qemu-test"
75+
echo "QEMU boot test will be run after build"
76+
;;
77+
"false"|"")
78+
echo "QEMU boot test will be skipped"
79+
;;
80+
*)
81+
echo "Invalid input for run_qemu_test: ${RUN_QEMU_TEST}"
82+
exit 1
83+
;;
84+
esac
85+
86+
# Run the ELXR12 DLStreamer image build script
87+
./scripts/build_elxr12_dlstreamer.sh $ARGS
88+
echo "ELXR12 DLStreamer image build completed."
89+
90+
- name: Notify on failure
91+
if: ${{ failure() && github.event_name == 'pull_request' }}
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
REVIEWER_ID: srmungar
95+
run: |
96+
PR_AUTHOR=$(jq --raw-output 'try .pull_request.user.login // empty' "$GITHUB_EVENT_PATH")
97+
if [ -z "$PR_AUTHOR" ]; then
98+
echo "PR_AUTHOR not found in event payload. Skipping notification."
99+
exit 0
100+
fi
101+
COMMENT_BODY="Hey @$PR_AUTHOR and @$REVIEWER_ID — the ELXR12 DLStreamer image build has failed. Please check the logs."
102+
curl -s -X POST \
103+
-H "Authorization: Bearer $GITHUB_TOKEN" \
104+
-H "Accept: application/vnd.github.v3+json" \
105+
--data "{\"body\": \"$COMMENT_BODY\"}" \
106+
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Build EMT3 DLStreamer Image
2+
on:
3+
workflow_dispatch: # Manual runs
4+
inputs:
5+
ref:
6+
description: "Branch or SHA to test (e.g. feature/x or a1b2c3)"
7+
required: false
8+
run_qemu_test:
9+
description: "Run QEMU boot test after build"
10+
required: false
11+
default: "false"
12+
type: choice
13+
options:
14+
- "true"
15+
- "false"
16+
push:
17+
branches:
18+
- main
19+
pull_request:
20+
branches:
21+
- main
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
build-emt3-dlstreamer:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Install Earthly
39+
uses: earthly/actions-setup@v1
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
version: "latest"
43+
44+
- name: Install system deps
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y qemu-system-x86 ovmf tree jq systemd-ukify mmdebstrap systemd-boot
48+
49+
- name: Set up Go
50+
uses: actions/setup-go@v5
51+
with:
52+
go-version: stable
53+
54+
- name: Prepare build script
55+
run: |
56+
if [ ! -f scripts/build_emt3_dlstreamer.sh ]; then
57+
echo "scripts/build_emt3_dlstreamer.sh not found!"
58+
exit 1
59+
fi
60+
chmod +x scripts/build_emt3_dlstreamer.sh
61+
62+
- name: Run EMT3 DLStreamer Image Build
63+
env:
64+
RUN_QEMU_TEST: ${{ github.event.inputs.run_qemu_test }}
65+
run: |
66+
echo "Starting EMT3 DLStreamer image build..."
67+
# Ensure script has access to docker group for Earthly
68+
sudo usermod -aG docker $USER
69+
70+
# Prepare arguments with input validation
71+
ARGS=""
72+
case "${RUN_QEMU_TEST}" in
73+
"true")
74+
ARGS="--qemu-test"
75+
echo "QEMU boot test will be run after build"
76+
;;
77+
"false"|"")
78+
echo "QEMU boot test will be skipped"
79+
;;
80+
*)
81+
echo "Invalid input for run_qemu_test: ${RUN_QEMU_TEST}"
82+
exit 1
83+
;;
84+
esac
85+
86+
# Run the EMT3 DLStreamer image build script
87+
./scripts/build_emt3_dlstreamer.sh $ARGS
88+
echo "EMT3 DLStreamer image build completed."
89+
90+
- name: Notify on failure
91+
if: ${{ failure() && github.event_name == 'pull_request' }}
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
REVIEWER_ID: srmungar
95+
run: |
96+
PR_AUTHOR=$(jq --raw-output 'try .pull_request.user.login // empty' "$GITHUB_EVENT_PATH")
97+
if [ -z "$PR_AUTHOR" ]; then
98+
echo "PR_AUTHOR not found in event payload. Skipping notification."
99+
exit 0
100+
fi
101+
COMMENT_BODY="Hey @$PR_AUTHOR and @$REVIEWER_ID — the EMT3 DLStreamer image build has failed. Please check the logs."
102+
curl -s -X POST \
103+
-H "Authorization: Bearer $GITHUB_TOKEN" \
104+
-H "Accept: application/vnd.github.v3+json" \
105+
--data "{\"body\": \"$COMMENT_BODY\"}" \
106+
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"

0 commit comments

Comments
 (0)