Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

build(linux): test the installed tarball on Ubuntu 22.04, 24.04 and arm64 in CI

wquguru33b49bc126cb
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
new file mode 100644
index 0000000..38980c2
--- /dev/null
+++ b/.github/workflows/linux.yml
@@ -0,0 +1,87 @@
+name: linux
+
+# The Linux app (linux/). The tarball is built once (with the voiceprint library for x86_64 and
+# aarch64, both from 22.04), then installed with its own install.sh on every Ubuntu we support and on
+# both architectures: unit tests against the shipped library, then a smoke test of the installed GTK
+# app under Xvfb with a PulseAudio null sink (windows open, the speakers' monitor is heard, 说话人识别
+# loads). The real desktop (GNOME, XWayland, focus, a real sound card) is tested in the VM and by hand.
+on:
+ push:
+ branches: [main]
+ paths: ["linux/**", "Resources/**/Localizable.strings", "VERSION", ".github/workflows/linux.yml"]
+ pull_request:
+ paths: ["linux/**", "Resources/**/Localizable.strings", "VERSION", ".github/workflows/linux.yml"]
+ workflow_dispatch:
+
+jobs:
+ # The voiceprint library for each architecture, on 22.04 so it loads on 22.04 and 24.04 (glibc).
+ native:
+ strategy:
+ matrix:
+ runner: [ubuntu-22.04, ubuntu-22.04-arm]
+ runs-on: ${{ matrix.runner }}
+ steps:
+ - uses: actions/checkout@v4
+ - run: linux/native/build.sh
+ - uses: actions/upload-artifact@v4
+ with:
+ name: voice-${{ matrix.runner }}
+ path: linux/native/out/libcicada-voice-*.so
+
+ package:
+ needs: native
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/download-artifact@v4
+ with:
+ pattern: voice-*
+ path: linux/native/out
+ merge-multiple: true
+ - name: Build
+ # ffmpeg turns the sample meeting into WAV (no afconvert on Linux).
+ run: sudo apt-get update -q && sudo apt-get install -y -q ffmpeg && linux/scripts/build.sh
+ - name: Both architectures are in it
+ run: |
+ tar -tzf linux/build/cicada-linux-*.tar.gz | grep -q 'lib/libcicada-voice-x86_64.so$'
+ tar -tzf linux/build/cicada-linux-*.tar.gz | grep -q 'lib/libcicada-voice-aarch64.so$'
+ - uses: actions/upload-artifact@v4
+ with:
+ name: Cicada-linux
+ path: linux/build/cicada-linux-*.tar.gz
+
+ # What a user gets: the tarball, installed by install.sh, on each supported Ubuntu and architecture.
+ check:
+ needs: package
+ strategy:
+ fail-fast: false
+ matrix:
+ runner: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm]
+ runs-on: ${{ matrix.runner }}
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/download-artifact@v4
+ with:
+ name: Cicada-linux
+ # What Ubuntu desktop ships (a CI runner is a server image), plus Xvfb and a sound server.
+ - name: Desktop libraries
+ run: sudo apt-get update -q && sudo apt-get install -y -q python3-gi gir1.2-gtk-3.0 gir1.2-ayatanaappindicator3-0.1 libpulse0 pulseaudio pulseaudio-utils xvfb
+ - name: Install
+ run: |
+ tar -xzf cicada-linux-*.tar.gz
+ sh cicada-linux/install.sh
+ test -x ~/.local/lib/cicada/bin/cicada
+ - name: Unit tests against the shipped voiceprint library
+ working-directory: linux
+ # A missing library would only skip the voiceprint test, so check it's there first.
+ run: |
+ lib="$HOME/.local/lib/cicada/lib/libcicada-voice-$(uname -m).so"
+ test -f "$lib"
+ CICADA_VOICE_LIB="$lib" scripts/test.sh
+ - name: Smoke test of the installed app
+ run: |
+ cp linux/scripts/smoke.sh linux/scripts/cicadactl ~/.local/lib/cicada/bin/
+ pulseaudio --start --exit-idle-time=-1
+ pactl load-module module-null-sink sink_name=speakers
+ pactl set-default-sink speakers
+ SMOKE_VOICES=1 xvfb-run -a ~/.local/lib/cicada/bin/smoke.sh
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 543b4ed..ed6c350 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -90,14 +90,37 @@ jobs:
name: windows
path: dist/*.zip
- linux:
+ # The voiceprint library (说话人识别) for each architecture, on 22.04 so it loads on 22.04 and 24.04.
+ linux-native:
needs: plan
if: needs.plan.outputs.linux == 'true'
+ strategy:
+ matrix:
+ runner: [ubuntu-22.04, ubuntu-22.04-arm]
+ runs-on: ${{ matrix.runner }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ env.TAG }}
+ - run: linux/native/build.sh
+ - uses: actions/upload-artifact@v4
+ with:
+ name: voice-${{ matrix.runner }}
+ path: linux/native/out/libcicada-voice-*.so
+
+ linux:
+ needs: [plan, linux-native]
+ if: needs.plan.outputs.linux == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TAG }}
+ - uses: actions/download-artifact@v4
+ with:
+ pattern: voice-*
+ path: linux/native/out
+ merge-multiple: true
- name: Build
# ffmpeg turns the sample meeting into WAV (no afconvert on Linux).
run: |
@@ -127,6 +150,7 @@ jobs:
# replace its files and notes instead. Without the Mac app the release is not marked
# latest: Macs on 1.0.0 read releases/latest and would offer a release with nothing for them.
run: |
+ rm -f dist/libcicada-voice-*.so # the voiceprint libraries are inside the Linux tarball, not files of their own
(cd dist && sha256sum -- * > checksums.txt)
cat dist/checksums.txt
scripts/release_notes.sh "${TAG#v}" > notes.md
diff --git a/linux/scripts/smoke.sh b/linux/scripts/smoke.sh
index 7b21953..6bd4be1 100755
--- a/linux/scripts/smoke.sh
+++ b/linux/scripts/smoke.sh
@@ -29,6 +29,8 @@ state="$("$ctl" state)"
echo "$state"
"$ctl" windows
python3 -c 'import json,sys; s=json.loads(sys.argv[1]); assert s["listening"], "not listening"; assert s["peak"] > 0.05, "monitor heard nothing (peak %s)" % s["peak"]' "$state"
+# SMOKE_VOICES=1 (CI, on the installed tarball): 说话人识别 must load, i.e. the shipped library links here.
+[ -z "${SMOKE_VOICES:-}" ] || python3 -c 'import json,sys; assert json.loads(sys.argv[1])["speakers"]["available"], "voiceprint library did not load"' "$state"
"$ctl" stop >/dev/null
"$ctl" quit >/dev/null || true
wait $app 2>/dev/null || true