Skip to content

De-duplicate docker workflow pipelines#218

Merged
lelia merged 1 commit into
lelia/fix-dependabot-checksfrom
lelia/improve-workflow-pipelines
May 31, 2026
Merged

De-duplicate docker workflow pipelines#218
lelia merged 1 commit into
lelia/fix-dependabot-checksfrom
lelia/improve-workflow-pipelines

Conversation

@lelia
Copy link
Copy Markdown
Contributor

@lelia lelia commented May 31, 2026

Summary

Speeds up and de-duplicates the Docker publish pipelines (release / PR preview / stable). No change to what gets published — only how the workflows are assembled and how fast they run.

Stacked on #217. Base is lelia/fix-dependabot-checks to avoid a pr-preview.yml conflict with that PR's Dependabot skip. GitHub auto-retargets this to main when #217 merges.

Speed (PR preview — the iterative path)

  • Concurrency cancel-in-progress — pushing a PR again now cancels the superseded preview run instead of letting the slow build churn. (python-tests/dependabot-review already had this; preview didn't.)
  • amd64-only preview images — arm64 under QEMU emulation was the slowest part of the job, and a preview image is just for quick testing. Release & stable keep multi-arch.
  • GHA Docker layer cache (type=gha) on all image builds — unchanged layers are reused across runs.

De-duplication (composite actions)

GitHub Actions doesn't support YAML anchors, so the idiomatic fix is local composite actions:

  • .github/actions/setup-docker-publish — the QEMU + Buildx + Docker Hub login trio, previously copied into all three Docker workflows. They had drifted to three different pinned SHA sets; now there's one. (Docker Hub creds passed as inputs, since composite actions can't read secrets.* directly.)
  • .github/actions/setup-hatch — the pinned virtualenv/hatchling/hatch install shared by release.yml and pr-preview.yml.

Test plan

  • All five touched/new files parse as valid YAML
  • QEMU/Buildx/login now appear only in the composite (0 refs left in workflows)
  • A preview run completes faster (amd64-only + cache) and gets cancelled when the PR is pushed again
  • A release dry-run still produces multi-arch images
  • Docker layer cache (type=gha) populates without permission errors

Notes / possible follow-ups

  • docker-stable.yml still pins actions/checkout + build-push-action to different SHAs than the other workflows. Left as-is — Dependabot's grouped github-actions updates will reconcile these going forward.
  • The Test PyPI "verify package available" polling loop (up to ~10 min) is untouched here; a future change could build the preview image from the locally-built wheel to skip the Test PyPI round-trip entirely.

Performance (PR preview, the iterative-feedback path):
- Add a concurrency group with cancel-in-progress so pushing a PR again
  cancels the superseded (slow) preview run instead of letting it churn.
- Build preview images amd64-only. arm64 under QEMU emulation was the
  slowest part of the job, and preview images are for quick testing;
  release/stable keep multi-arch.
- Enable GitHub Actions Docker layer cache (type=gha) on all image builds
  so unchanged layers are reused across runs.

De-duplication (GitHub Actions has no YAML anchors, so use composite actions):
- New .github/actions/setup-docker-publish: the QEMU + Buildx + Docker Hub
  login trio, shared by release.yml, pr-preview.yml, and docker-stable.yml.
  These had drifted to three different pinned SHA sets; now there is one.
  (Docker Hub creds are passed as inputs since composite actions can't read
  secrets directly.)
- New .github/actions/setup-hatch: the pinned virtualenv/hatchling/hatch
  install shared by release.yml and pr-preview.yml.

No behavior change to what gets published; only how the pipelines are
assembled and how fast/parallel they run.

Stacked on #217 (lelia/fix-dependabot-checks) to avoid a pr-preview.yml
conflict with that PR's Dependabot skip; rebase onto main once #217 lands.

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia lelia requested a review from a team as a code owner May 31, 2026 00:45
@github-actions
Copy link
Copy Markdown

🚀 Preview package published!

Install with:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==2.3.0.dev15

Docker image: socketdev/cli:pr-218

@lelia lelia changed the title Improve GitHub Actions workflows De-duplicate docker workflow pipelines May 31, 2026
@lelia lelia merged commit 88b510e into lelia/fix-dependabot-checks May 31, 2026
17 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