Skip to content

Latest commit

 

History

History
107 lines (72 loc) · 6.87 KB

workflow.md

File metadata and controls

107 lines (72 loc) · 6.87 KB

GitHub Actions Workflows

This project uses three separate Docker build workflows that automatically build and publish Docker images to GitHub Container Registry (ghcr.io).

Workflows Overview

Workflow Trigger Image Tag(s)
docker-build-release.yml Tags: v1.2.0, v1.2.0-alpha1 1.2.0, 1.2, latest
docker-build-nightly.yml Push to main nightly
docker-build-pr.yml Pull requests pr-<pr-number>

The image workflows are joined by e2e-tests.yml (E2E-Tests), which builds no image. It runs in the same cases as the image builds: on push to main (nightly), on pull requests (pr, on pull_request: read-only token and no secrets, so it needs no pr-build approval) and on version tags (release), and not for changes that only touch **.md or docs/**. It has two jobs, each with its own job summary (annotations for failed tests) and artifact with the LVA log and JUnit XML: LVA runs tests/e2e without tests/e2e/peripheral_api (artifact e2e-results), LVA-Peripheral-API-V1 runs tests/e2e/peripheral_api only (artifact e2e-peripheral-results). See tests/e2e/README.md.

docker-compose-test.yml (Docker-Compose-Test) runs on pull requests only (not on push to main or on version tags), and not for changes that only touch **.md or docs/**. It builds the image of the commit for amd64 only, without pushing it (so it also runs on pull_request without pr-build approval), and runs .github/scripts/compose_smoke_test.sh with it: the script validates docker-compose.yml and docker-compose.dev.yml with docker compose config, starts a private PulseAudio server with a virtual speaker and microphone, writes an env file from .env.example with the paths of that server and the runner's user, and starts docker-compose.yml. It passes when fix-permissions exited with 0 and LVA records from the sound server and answers an ESPHome Hello on its port within 120 s, without a restart. The Compose log is uploaded as the artifact compose-results. Locally it is only needed when a change touches docker-compose.yml, docker-compose.dev.yml or docker-entrypoint.sh, otherwise the pull request run is enough: LVA_IMAGE=<image> LVA_IMAGE_TAG=<tag> .github/scripts/compose_smoke_test.sh (set COMPOSE_TEST_PORT/COMPOSE_TEST_PERIPHERAL_PORT when an LVA already runs on the machine).

The unit test workflow (unit-tests.yml) publishes its result the same way: ./script/tests --junitxml=<file> writes a JUnit XML, .github/scripts/junit_summary.py turns it into the job summary and failure annotations (a long test list is collapsed), and the XML is uploaded as the artifact unit-results.

Detailed Description

Release Workflow (docker-build-release.yml)

Publishes versioned images for new releases.

Triggers:

  • Tags matching v[0-9]+.[0-9]+.[0-9]+ (e.g., v1.0.0)
  • Tags matching v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+ (e.g., v1.0.0-alpha1)

Image Tags:

ghcr.io/ohf-voice/linux-voice-assistant:1.0.0
ghcr.io/ohf-voice/linux-voice-assistant:1.0
ghcr.io/ohf-voice/linux-voice-assistant:1
ghcr.io/ohf-voice/linux-voice-assistant:latest

Nightly Workflow (docker-build-nightly.yml)

Automatically builds nightly images from the main branch.

Triggers:

  • Push to main branch

Concurrency: A new push to main cancels a run of this workflow that is still in progress, including all its jobs (build-and-push-64, build-and-push-32, merge-32). Only the newest commit is built, and an outdated run can no longer move the nightly tag back to an older image. A cancelled run shows as "cancelled", not as failed.

Image Tag:

ghcr.io/ohf-voice/linux-voice-assistant:nightly

PR Workflow (docker-build-pr.yml)

Builds images for pull requests using the PR number as tag.

Triggers:

  • Pull request opened, synchronized, or reopened

Image Tag:

ghcr.io/ohf-voice/linux-voice-assistant:pr-<pr-number>

Issue labels

issue-labels.yaml runs when an issue is opened or edited. Both issue templates (.github/ISSUE_TEMPLATE/: "Report a bug" and "Submit a finished feature") start with a "Type of issue" list, with the box of the template already ticked. The workflow sets the label of the ticked box (bug, new-feature or enhancement) and removes the other two. With no box or several boxes ticked it leaves the labels alone. Feature ideas and questions go to the Discussions, see config.yml.

Breaking change log

Migration notes for breaking changes are collected in breaking_change.md (never edited by hand). The helper is .github/scripts/breaking_change.py.

Workflow Trigger What it does
pr-labels.yaml PR opened/edited When the PR gets the breaking-change label, fails the check unless the "Breaking change migration" section of the PR description has text.
breaking-change-log.yml PR merged with label breaking-change Adds #<number> <title> and the migration text at the top of the ## Unreleased section and pushes to main. A PR that is already listed is not added twice.
gen_changelog.yml Release published (not prereleases) Renames ## Unreleased to ## <tag> (<date>), appends the entries as ## Breaking change migration to the release notes (before CHANGELOG.md is generated from them) and pushes the file to main.

Multi-Architecture Support

All workflows build for multiple architectures:

  • linux/amd64 (x86_64)
  • linux/aarch64 (ARM 64-bit, e.g., Raspberry Pi 4)
  • linux/arm/v7 (ARM 32-bit)

Each workflow has three jobs. The slow armv7 build does not delay the 64-bit platforms:

  1. build-and-push-64 builds amd64 + arm64 and publishes the tag.
  2. build-and-push-32 builds armv7 in parallel and pushes it by digest only (no tag).
  3. merge-32 runs after both and adds the armv7 image to the already published tags, so the same tag contains all three architectures.

amd64/arm64 can be used as soon as job 1 is done. Until merge-32 has finished, the tag has no armv7 variant. If build-and-push-32 fails, the tag stays at amd64 + arm64.

Setup Requirements

No additional setup needed! The workflows use GITHUB_TOKEN which is automatically provided by GitHub Actions.

Creating a Release

git tag v1.0.0
git push origin v1.0.0

This creates images with the following tags:

  • ghcr.io/ohf-voice/linux-voice-assistant:1.0.0
  • ghcr.io/ohf-voice/linux-voice-assistant:1.0
  • ghcr.io/ohf-voice/linux-voice-assistant:1
  • ghcr.io/ohf-voice/linux-voice-assistant:latest