Skip to content

Commit f3f88c2

Browse files
committed
Use sippy/cimagic/.github/workflows/BuildDPKGs.yml.
1 parent f22ec0d commit f3f88c2

File tree

4 files changed

+51
-79
lines changed

4 files changed

+51
-79
lines changed

.github/workflows.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ do_FuncTest=true
66
do_Fuzzing=true
77
do_Glitch=true
88
do_MinBuild=true
9-
do_DebianPackage=true
9+
do_BuildPackages=true

.github/workflows/.jobs_configure.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ on:
2121
do_MinBuild:
2222
description: "Whether the current workflow should continue"
2323
value: ${{ jobs.check_disabled_actions.outputs.do_MinBuild }}
24-
do_DebianPackage:
24+
do_BuildPackages:
2525
description: "Whether the current workflow should continue"
26-
value: ${{ jobs.check_disabled_actions.outputs.do_DebianPackage }}
26+
value: ${{ jobs.check_disabled_actions.outputs.do_BuildPackages }}
2727

2828
jobs:
2929
check_disabled_actions:
@@ -36,7 +36,7 @@ jobs:
3636
do_Fuzzing: ${{ steps.check_status.outputs.do_Fuzzing }}
3737
do_Glitch: ${{ steps.check_status.outputs.do_Glitch }}
3838
do_MinBuild: ${{ steps.check_status.outputs.do_MinBuild }}
39-
do_DebianPackage: ${{ steps.check_status.outputs.do_DebianPackage }}
39+
do_BuildPackages: ${{ steps.check_status.outputs.do_BuildPackages }}
4040
steps:
4141
- name: Checkout code
4242
uses: actions/checkout@v4

.github/workflows/rtpproxy_ci.yml

Lines changed: 12 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -99,80 +99,14 @@ jobs:
9999
- name: build
100100
run: sh -x ./scripts/do-build.sh cleanbuild
101101

102-
DebianPackage:
103-
name: Debian Package Build
102+
BuildPackages:
103+
name: Build Packages
104104
needs: [LoadJobs_conf, FullBuild]
105-
if: needs.LoadJobs_conf.outputs.do_DebianPackage == 'true'
106-
runs-on: ubuntu-24.04
107-
steps:
108-
- uses: actions/checkout@v4
109-
with:
110-
submodules: 'recursive'
111-
- name: Install build tools
112-
run: |
113-
sudo apt-get update
114-
sudo apt-get install -y build-essential devscripts debhelper pkg-config libssl-dev libbcg729-dev libgsm1-dev libsndfile1-dev libunwind-dev libsrtp2-dev libsystemd-dev fakeroot zip
115-
- name: Build Debian package
116-
env:
117-
DEB_BUILD_OPTIONS: nocheck
118-
run: |
119-
dpkg-buildpackage -us -uc -b
120-
121-
- name: Collect Debian packages
122-
run: |
123-
set -euo pipefail
124-
mkdir -p debian-artifacts
125-
shopt -s nullglob
126-
for artifact in ../*.deb ../*.ddeb ../*.buildinfo ../*.changes; do
127-
[ -e "${artifact}" ] || continue
128-
base=$(basename "${artifact}")
129-
mv "${artifact}" "debian-artifacts/${base}"
130-
done
131-
132-
- name: Test install Debian packages
133-
run: |
134-
set -euo pipefail
135-
shopt -s nullglob
136-
pkgs=(./debian-artifacts/*.deb)
137-
if [ "${#pkgs[@]}" -eq 0 ]; then
138-
echo "No Debian packages produced" >&2
139-
exit 1
140-
fi
141-
sudo apt-get install -y "${pkgs[@]}"
142-
143-
- name: Exercise systemd service
144-
run: |
145-
set -euo pipefail
146-
trap 'status=$?; sudo journalctl -xeu rtpproxy.service || true; exit $status' ERR
147-
trap 'sudo systemctl disable --now rtpproxy.socket || true' EXIT
148-
sudo systemctl daemon-reload
149-
sudo systemctl enable --now rtpproxy.socket
150-
sudo systemctl start rtpproxy.service
151-
sudo systemctl status --no-pager rtpproxy.service
152-
sudo systemctl restart rtpproxy.service
153-
sudo systemctl status --no-pager rtpproxy.service
154-
sudo systemctl stop rtpproxy.service
155-
sudo systemctl status --no-pager rtpproxy.service || true
156-
157-
- name: Setup GitHub Actions artifact client
158-
uses: lhotari/gh-actions-artifact-client@v2
159-
160-
- name: Upload Debian artifacts
161-
run: |
162-
set -euo pipefail
163-
shopt -s nullglob
164-
uploaded=0
165-
for file in debian-artifacts/*.deb debian-artifacts/*.ddeb debian-artifacts/*.buildinfo debian-artifacts/*.changes; do
166-
[ -e "$file" ] || continue
167-
uploaded=1
168-
name=$(basename "$file")
169-
echo "Uploading $name, file: $file"
170-
zip - "$file" | gh-actions-artifact-client.js upload "$name" --retentionDays=7
171-
done
172-
if [ "$uploaded" -eq 0 ]; then
173-
echo "No Debian artifacts found for upload" >&2
174-
exit 1
175-
fi
105+
uses: sippy/cimagic/.github/workflows/BuildDPKGs.yml@v2
106+
if: always() && needs.LoadJobs_conf.outputs.do_BuildPackages == 'true'
107+
with:
108+
apt_depends: pkg-config libssl-dev libbcg729-dev libgsm1-dev libsndfile1-dev libunwind-dev libsrtp2-dev libsystemd-dev systemd procps
109+
test_dpkgs_script: ./scripts/do-dpkg-test.sh
176110

177111
FullBuild:
178112
name: Full Build
@@ -626,7 +560,10 @@ jobs:
626560

627561
roll_release:
628562
name: Roll Release
629-
needs: [LoadJobs_conf, Docker, DebianPackage]
563+
needs: [LoadJobs_conf, Docker, BuildPackages]
630564
permissions:
631565
contents: write
632-
uses: sippy/cimagic/.github/workflows/RollReleaseDraft.yml@v1
566+
uses: sippy/cimagic/.github/workflows/RollReleaseDraft.yml@v2
567+
with:
568+
release_files_artifacts: |
569+
${{ needs.BuildPackages.outputs.dpkgs_artifacts }}

scripts/do-dpkg-test.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
set -x
5+
6+
start_systemd() {
7+
find /lib/systemd/system/sysinit.target.wants -mindepth 1 -maxdepth 1 \! -name systemd-tmpfiles-setup.service | xargs rm -f
8+
rm -f /lib/systemd/system/multi-user.target.wants/\*
9+
rm -f /etc/systemd/system/\*.wants/\*
10+
rm -f /lib/systemd/system/local-fs.target.wants/\*
11+
rm -f /lib/systemd/system/sockets.target.wants/\*udev\*
12+
rm -f /lib/systemd/system/sockets.target.wants/\*initctl\*
13+
rm -f /lib/systemd/system/basic.target.wants/\*
14+
rm -f /lib/systemd/system/anaconda.target.wants/\*
15+
16+
unshare --pid --fork --mount-proc /lib/systemd/systemd --system-unit=basic.target --system &
17+
sleep 1
18+
}
19+
20+
start_systemd
21+
systemd_pid=`ps -C systemd -o pid=`
22+
23+
NSRUN="nsenter -t ${systemd_pid} -a"
24+
25+
${NSRUN} systemctl daemon-reload
26+
${NSRUN} systemctl enable --now rtpproxy.socket
27+
${NSRUN} systemctl start rtpproxy.service
28+
${NSRUN} systemctl status --no-pager rtpproxy.service
29+
${NSRUN} systemctl restart rtpproxy.service
30+
${NSRUN} systemctl status --no-pager rtpproxy.service
31+
${NSRUN} systemctl stop rtpproxy.service
32+
${NSRUN} systemctl status --no-pager rtpproxy.service || true
33+
${NSRUN} systemctl disable rtpproxy.socket
34+
${NSRUN} systemctl is-enabled rtpproxy.socket || true
35+
${NSRUN} systemctl status --no-pager rtpproxy.socket || true

0 commit comments

Comments
 (0)