← Back to issue list

ci: deduplicate snap packaging across spread and test workflows

View original Github issue

Metadata

Project
charmcraft
Number
#2978
Type
pull request
State
open
Author
LoweRAM
Labels
—
Created
Updated
Closed
—

Current evaluation

Consolidates four CI workflows into a single spread.yaml to deduplicate snap builds, removing redundant workflows and adding path filtering. Has 18 unresolved review comments and 2 failing CI checks.

Suggested action: needs review

Reason: The PR consolidates four CI workflows into one to eliminate redundant snap builds, a meaningful CI optimization. However, it has 18 unresolved review comments and two failing CI checks (OSV-scanner, zizmor), indicating it still needs author responses and fixes before merge.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 8 Complexity: 40 Confidence: 65 Actionability: 30

Issue body

Consolidate snap-dependent jobs into a single unified `spread.yaml` workflow so that the Charmcraft snap is built once and shared across all spread test jobs and PR snap publishing, eliminating redundant snap builds. ### Problem Previously, four separate workflows each defined independent `snap-build` jobs using `action-build`: - `tests.yaml` built the snap on every PR solely to publish it to `edge/pr-*`. - `spread.yaml` built the snap on every PR to run source and store spread tests. - `spread-docs.yaml` built the snap whenever doc code changed to run doc spread tests. - `spread-manual.yaml` built the snap whenever manual spread runs were triggered. Across a single PR's lifecycle (PR creation and subsequent merge to `main`), the exact same snap was built up to 5 times, wasting runner time and delaying test completion. ### Solution 1. Consolidate `snap-publish` (from `tests.yaml`), `docs-tests` (from `spread-docs.yaml`), and `manual-spread-tests` (from `spread-manual.yaml`) into `.github/workflows/spread.yaml`. 2. Add a fast `filter` step via `dorny/paths-filter` to detect whether source, docs, or manual spread runs are needed. 3. Build the snap once in `snap-build` (upgraded to `canonical/action-build@v1`) only when needed, and share the build artifact across all downstream jobs. 4. Remove the redundant `tests.yaml`, `spread-docs.yaml`, and `spread-manual.yaml` workflow files. 5. Update the `Tests` badge in `README.md` to point to `qa.yaml` where unit and integration tests actually run. ### Verification - Validated all workflow syntax with `actionlint` (0 errors). - Audited with `zizmor` (eliminated multiple unpinned/deprecated warnings and excessive permission warnings from removed workflows). - Verified local linting and tests pass with `ruff check`, `ruff format --diff`, `ty check`, and `make test-fast`.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b
Impact: 45
Quick Win: 8
Complexity: 40
Confidence: 65
Actionability: 30
needs review Consolidates four CI workflows into a single spread.yaml to deduplicate snap builds, removing redundant workflows and adding path filtering. Has 18 unresolved review comments and 2 failing CI checks.

Update history

Date Change
created

Related work

  • Related To: fetch-service#432 (confidence 70%)

    Similar CI workflow deduplication effort in fetch-service; same pattern of consolidating snap-build and spread testing workflows.

Related issues

Issue Project State Summary Similarity
#6408 Re-organize spread tests snapcraft open Maintainer-filed, triaged enhancement to reorganize/dedupe Snapcraft's spread tests and drop low-value ones for faster, less flaky CI; no implementation plan or PR yet, tracked as SNAPCRAFT-1377.
73%
#432 ci: speed up spread testing workflow fetch-service merged Merged PR #432 (commit 9eec284), removing snap-test's dependency on snap-build so spread tests start sooner while snap-build still produces downloadable artifacts.
71%
#2774 test: speed up spread test runtime by removing redundant package setup charmcraft open Removes redundant apt update calls and consolidates package installs in spread tests to reduce runtime. All CI passing, awaiting review of 1 unresolved comment.
71%