Files
voculinux/.github/workflows/unified-pipeline.yml
T
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3c94f021fd chore(deps): bump the github-actions group with 11 updates (#766)
Bumps the github-actions group with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `5.1.0` | `7.0.1` |
| [actions/labeler](https://github.com/actions/labeler) | `6.2.0` | `7.0.0` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5.6.0` | `7.0.0` |
| [actions/cache](https://github.com/actions/cache) | `4.3.0` | `6.1.0` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.2` | `7.0.1` |
| [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `2.6.2` | `3.0.2` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4.3.0` | `8.0.1` |
| [actions/setup-node](https://github.com/actions/setup-node) | `5.0.0` | `7.0.0` |
| [dorny/paths-filter](https://github.com/dorny/paths-filter) | `3.0.4` | `4.0.3` |
| [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `6.8.0` | `10.0.1` |
| [codecov/codecov-action](https://github.com/codecov/codecov-action) | `4.6.0` | `7.0.0` |


Updates `actions/checkout` from 5.1.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09...3d3c42e5aac5ba805825da76410c181273ba90b1)

Updates `actions/labeler` from 6.2.0 to 7.0.0
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/b8dd2d9be0f68b860e7dae5dae7d772984eacd6d...bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13)

Updates `actions/setup-python` from 5.6.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/a26af69be951a213d495a4c3e4e4022e16d87065...5fda3b95a4ea91299a34e894583c3862153e4b97)

Updates `actions/cache` from 4.3.0 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/0057852bfaa89a56745cba8c7296529d2fc39830...55cc8345863c7cc4c66a329aec7e433d2d1c52a9)

Updates `actions/upload-artifact` from 4.6.2 to 7.0.1
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/ea165f8d65b6e75b540449e92b4886f43607fa02...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a)

Updates `softprops/action-gh-release` from 2.6.2 to 3.0.2
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/3bb12739c298aeb8a4eeaf626c5b8d85266b0e65...3d0d9888cb7fd7b750713d6e236d1fcb99157228)

Updates `actions/download-artifact` from 4.3.0 to 8.0.1
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/d3f86a106a0bac45b974a628896c90dbdf5c8093...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c)

Updates `actions/setup-node` from 5.0.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/a0853c24544627f65ddf259abe73b1d18a591444...820762786026740c76f36085b0efc47a31fe5020)

Updates `dorny/paths-filter` from 3.0.4 to 4.0.3
- [Release notes](https://github.com/dorny/paths-filter/releases)
- [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dorny/paths-filter/compare/0e4a8c6effa4802afeda77dc8d303f8176d7dfad...ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d)

Updates `astral-sh/setup-uv` from 6.8.0 to 10.0.1
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/d0cc045d04ccac9d8b7881df0226f9e82c39688e...20cfd1bf945f4377ade1205e4dbc17946fc9a30d)

Updates `codecov/codecov-action` from 4.6.0 to 7.0.0
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238...fb8b3582c8e4def4969c97caa2f19720cb33a72f)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/labeler
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/setup-python
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/cache
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: dorny/paths-filter
  dependency-version: 4.0.3
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: codecov/codecov-action
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-01 01:06:15 -07:00

397 lines
14 KiB
YAML

name: Vocalinux CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: 🔎 Detect Changes
runs-on: ubuntu-latest
outputs:
web: ${{ steps.filter.outputs.web }}
python: ${{ steps.filter.outputs.python }}
deploy_website: ${{ steps.deploy_check.outputs.deploy }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: filter
with:
filters: |
web:
- 'web/**'
- '.github/workflows/unified-pipeline.yml'
python:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
# 'requirements*.txt' does not match requirements/runtime.txt: a
# glob star stops at the slash. The exports and the AppImage build
# gate the same jobs, so a change to either has to reach them.
- 'requirements/**'
- 'packaging/appimage/**'
- 'uv.lock'
# These three end up inside the AppImage: build.sh reads the
# pywhispercpp pin out of install.sh and installs the desktop
# entry and the icon into the AppDir.
- 'install.sh'
- 'vocalinux.desktop'
- 'resources/**'
- 'justfile'
- '.pre-commit-config.yaml'
- '.github/workflows/unified-pipeline.yml'
- name: Check if website should deploy
id: deploy_check
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
# Deploy if web files changed OR python files changed (for version updates)
# Use heredoc to safely handle multi-line commit messages
COMMIT_MSG_FILE=$(mktemp)
printenv COMMIT_MESSAGE > "$COMMIT_MSG_FILE"
# Use case-insensitive matching with grep
if [[ "${{ steps.filter.outputs.web }}" == "true" ]] || \
[[ "${{ steps.filter.outputs.python }}" == "true" ]] || \
[[ "${{ github.event_name }}" == "workflow_dispatch" ]] || \
grep -iE "(feat\(website\)|docs\(website\)|chore\(website\)|fix\(website\)|refactor\(website\))" "$COMMIT_MSG_FILE"; then
echo "deploy=true" >> $GITHUB_OUTPUT
else
echo "deploy=false" >> $GITHUB_OUTPUT
fi
rm -f "$COMMIT_MSG_FILE"
python-lint:
name: 🔍 Lint Python
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.python == 'true'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
# --only-group lint installs the linters without the project itself, so
# this job needs no portaudio/girepository headers to build pyaudio and
# PyGObject. --locked fails if uv.lock drifts from pyproject.toml, so the
# tool versions are the ones `just lint` uses locally.
- name: Lint with flake8 (critical errors)
run: |
uv run --locked --only-group lint flake8 src/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Check formatting with black
run: |
uv run --locked --only-group lint black --check --diff src/ tests/
- name: Check import sorting with isort
run: |
uv run --locked --only-group lint isort --check-only --diff --profile black src/ tests/
python-test:
name: 🧪 Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [changes, python-lint]
if: needs.changes.outputs.python == 'true'
strategy:
fail-fast: false
matrix:
# Every version requires-python promises; keep in sync with the
# classifiers in pyproject.toml (tests/test_python_version_policy.py).
python-version: ['3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
xdotool \
gir1.2-appindicator3-0.1 \
libcairo2-dev \
pkg-config \
python3-dev \
libgirepository1.0-dev \
gobject-introspection \
libcairo-gobject2 \
gir1.2-gtk-3.0 \
portaudio19-dev
- name: Install GObject introspection dependencies
run: |
sudo apt-get update
# For Ubuntu 24.04+ (or the latest GitHub Actions runner image)
sudo apt-get install -y gir1.2-glib-2.0 libgirepository-2.0-dev pkg-config
# Alternatively, for older Ubuntu versions (like 22.04), you might need:
# sudo apt-get install -y libgirepository1.0-dev pkg-config
# PyGObject is built from the lock here: the runner has glib 2.80+ and the
# -dev headers installed above. End users get the distro package instead
# (install.sh builds venv/ with --system-site-packages).
- name: Install dependencies from uv.lock
run: uv sync --locked --extra dev --extra vad
- name: Run tests with coverage
run: |
# Set GI_TYPELIB_PATH so pip-installed PyGObject can find system typelibs (AppIndicator3, etc.)
# Use dynamic detection for cross-distro compatibility, fallback to common Ubuntu paths
export GI_TYPELIB_PATH=$(pkg-config --variable=typelibdir gobject-introspection-1.0 2>/dev/null || echo "/usr/lib/x86_64-linux-gnu/girepository-1.0:/usr/lib/girepository-1.0")
PYTHONPATH=$PWD uv run --locked --extra dev --extra vad pytest --junitxml=junit-${{ matrix.python-version }}.xml --cov=src --cov-report=xml tests/
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results-${{ matrix.python-version }}
path: junit-${{ matrix.python-version }}.xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.13'
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false
just-contributor-path:
name: 🧰 Contributor Path (just)
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [changes, python-lint]
if: needs.changes.outputs.python == 'true'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
# Caches uv's download cache, not .venv/, so the checkout below stays
# the fresh clone this job exists to exercise.
enable-cache: true
- name: Install just
run: |
uv tool install rust-just
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgirepository-2.0-dev \
libcairo2-dev \
pkg-config \
python3-dev \
portaudio19-dev \
gir1.2-gtk-3.0 \
gir1.2-appindicator3-0.1 \
xdotool
# The rest of the pipeline drives uv directly, so nothing here checks that
# the workflow CONTRIBUTING documents still works. `just deps` is skipped on
# purpose: running it first would populate .venv/ and hide exactly the
# breakage this job is for, where `uv run --no-sync` finds no interpreter to
# run the tooling with.
- name: just test, from a clean checkout
run: just test
appimage-smoke-test:
name: 📦 Build AppImage (smoke test, ${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
needs: changes
if: needs.changes.outputs.python == 'true'
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-latest
- arch: aarch64
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.11'
cache: 'pip'
- name: Build wheel
run: |
python -m pip install --upgrade pip build
python -m build
ls -la dist/
# glslc is built from the pinned shaderc commit inside the container -
# Ubuntu 22.04 packages none - and depends on nothing but that commit.
- name: Cache AppImage build tools
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/vocalinux-appimage
key: appimage-tools-${{ matrix.arch }}-${{ hashFiles('packaging/appimage/tool_checksums.txt') }}
- name: Build AppImage
env:
VOCALINUX_APPIMAGE_REQUIRE_VULKAN: "1"
run: |
VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' src/vocalinux/version.py)
WHEEL=$(ls dist/*.whl)
bash packaging/appimage/docker-build.sh "$WHEEL" "$VERSION" dist
ls -la dist/*.AppImage
- name: Upload AppImage artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: vocalinux-appimage-${{ matrix.arch }}
path: dist/*.AppImage
retention-days: 7
# The build host cannot see what breaks here: its libraries match what it
# bundled. Two regressions reached a user that way (#743) — one loading a GI
# library, one spawning a host binary — and both die on the new distros below.
# Old ones prove the glibc floor the build image sets.
appimage-boot-test:
name: 🐧 Boot AppImage (${{ matrix.distro }})
runs-on: ubuntu-latest
needs: [changes, appimage-smoke-test]
if: needs.changes.outputs.python == 'true'
strategy:
fail-fast: false
matrix:
distro:
- debian:12
- ubuntu:22.04
- ubuntu:24.04
- fedora:42
- archlinux:latest
- opensuse/tumbleweed
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download the AppImage built above
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: vocalinux-appimage-x86_64
path: dist
- name: Boot it on ${{ matrix.distro }}
run: |
APPIMAGE=$(ls dist/*.AppImage)
chmod +x "$APPIMAGE"
docker run --rm \
-v "$PWD/dist:/dist:ro" \
-v "$PWD/packaging/appimage:/pk:ro" \
"${{ matrix.distro }}" \
bash /pk/boot-test.sh "/dist/$(basename "$APPIMAGE")"
web-build:
name: 🌐 Build Website
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.deploy_website == 'true'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: './web/package-lock.json'
- name: Install dependencies
working-directory: ./web
run: npm ci || npm install
- name: Sync version from source code
run: |
VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' src/vocalinux/version.py)
echo "Syncing version: $VERSION"
# JSON-LD uses unquoted JS keys: softwareVersion: "x.y.z"
if grep -qE 'softwareVersion:\s*"' web/src/app/page.tsx; then
sed -i 's/softwareVersion: "[^"]*"/softwareVersion: "'"$VERSION"'"/' web/src/app/page.tsx
echo "Updated page.tsx version:"
grep -oP 'softwareVersion:\s*"\K[^"]+' web/src/app/page.tsx
elif grep -qE 'softwareVersion:\s*"' web/src/app/layout.tsx; then
sed -i 's/softwareVersion: "[^"]*"/softwareVersion: "'"$VERSION"'"/' web/src/app/layout.tsx
echo "Updated layout.tsx version:"
grep -oP 'softwareVersion:\s*"\K[^"]+' web/src/app/layout.tsx
else
echo "::warning::No softwareVersion field found in page.tsx or layout.tsx; skipping sync"
fi
# Update package.json version (remove -alpha suffix for npm)
NPM_VERSION=${VERSION%-*}
sed -i 's/"version": "[^"]*"/"version": "'"$NPM_VERSION"'"/' web/package.json
# Verify the changes
echo "Updated package.json version:"
grep -oP '"version":\s*"\K[^"]+' web/package.json
- name: Lint
working-directory: ./web
run: npm run lint || true
- name: Type check
working-directory: ./web
run: npm run test:types || true
- name: Build
working-directory: ./web
run: npm run build
deploy-website:
name: 🚀 Deploy Website
runs-on: ubuntu-latest
needs: [changes, web-build]
if: |
always() &&
github.ref == 'refs/heads/main' &&
needs.changes.outputs.deploy_website == 'true' &&
needs.web-build.result == 'success'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: './web/package-lock.json'
- name: Install and build
working-directory: ./web
run: |
npm ci || npm install
npm run deploy
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web/out
publish_branch: gh-pages
cname: vocalinux.com
force_orphan: true