Skip to content

Feat/snap ci test#10

Merged
ted-gould merged 5 commits intomainfrom
feat/snap-ci-test
May 24, 2025
Merged

Feat/snap ci test#10
ted-gould merged 5 commits intomainfrom
feat/snap-ci-test

Conversation

@ted-gould
Copy link
Owner

No description provided.

This commit introduces a new GitHub Actions workflow job, `snap-test`,
to automate the building, installation, and testing of the xTeVe snap.

The `snap-test` job performs the following actions:
- Builds the snap using `snapcraft`.
- Installs the built snap locally on the runner.
- Waits for 10 seconds to allow the xTeVe service to start.
- Checks if the `xteve` service is active.
- Dumps the service logs (`snap logs xteve`) to STDOUT for debugging.

If the service is not found to be active after installation, the CI job
will fail, ensuring that issues with the snap packaging or service startup
are caught early.
This commit introduces a GitHub Actions workflow job (`snap-test`)
for building, installing, and testing the xTeVe snap.

The `snap-test` job includes the following operations:
- Builds the snap using `snapcraft`.
- Installs the snap on the CI runner.
- Waits for the service to start.
- Verifies that the `xteve` service is active.
- Dumps service logs to STDOUT.

Additionally, this commit adds a new markdown file
`.github/workflows/SNAP_CI_EXPECTED_OUTPUT.md`. This document
details the expected console output for the key commands within
the `snap-test` CI job, serving as a reference for developers
and you.
This commit fixes the installation method for snapcraft and LXD in the
`snap-test` GitHub Actions workflow job.

The previous method used `apt-get` for these tools, which failed as
they are primarily distributed as snaps.

Changes include:
- Modified `.github/workflows/ci.yml`:
  - `snapcraft` is now installed via `sudo snap install snapcraft --classic`.
  - `lxd` is now installed via `sudo snap install lxd`.
  - `qemu-kvm` is added as an explicit apt dependency.
  - Ensured LXD group creation and user addition to the group.
- Updated `.github/workflows/SNAP_CI_EXPECTED_OUTPUT.md`:
  - Reflected the new installation commands and added a section for
    LXD group configuration.

These changes should resolve the package installation errors encountered
in the CI environment.
This commit updates the snap CI build process to use
`sudo snapcraft --destructive-mode`.

This change is intended to resolve network access issues encountered
when snapcraft attempts to build within an LXD container in the
CI environment. Building with `--destructive-mode` runs the build
directly on the host, which can bypass such networking problems.

Changes:
- Modified `.github/workflows/ci.yml`:
  - The "Build the snap" step now uses `sudo snapcraft --destructive-mode`
    instead of `sg lxd -c "snapcraft"`.
- Updated `.github/workflows/SNAP_CI_EXPECTED_OUTPUT.md`:
  - Reflected the new snapcraft command and added a note explaining
    `--destructive-mode`.
This commit fixes the service name verification in the snap CI job.
The `snap services xteve` command outputs the service as `xteve.xteve`,
but the previous pattern was looking for `xteve`.

Changes:
- Modified `.github/workflows/ci.yml`:
  - The command in the "Check service status and dump logs" step
    now correctly uses the pattern `^xteve\.xteve\s+.*active` to
    match the actual service name.
- Updated `.github/workflows/SNAP_CI_EXPECTED_OUTPUT.md`:
  - Reflected the corrected service name in the example output and
    the command.
@ted-gould ted-gould merged commit 59164a1 into main May 24, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant