Improve GitHub Workflow performance#507
Open
fdcastel wants to merge 5 commits into
Open
Conversation
Upgrade the following actions to versions that use the Node.js 24 runtime: - golangci/golangci-lint-action: v8.0.0 -> v9.2.0 - release-drafter/release-drafter: v6.1.0 -> v7.1.1 - docker/setup-buildx-action: v3.12.0 -> v4.0.0 - docker/build-push-action: v6.18.0 -> v7.0.0 Closes openpubkey#494
ac7e12f to
301455f
Compare
Contributor
Author
|
Rebased this branch onto #508 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #506
This branch speeds up GitHub Actions in three ways:
The biggest improvement is the Windows GitHub provider workflow on forks.
That reduction comes from moving the
windows-11-armprovider job to upstream-only coverage instead of running it on every fork push.Baseline Runs
Baseline branch:
fix-gha-go-runOptimized branch:
improve-gha-performanceMeasured Differences
setup-gocaching restoredgo mod downloadworkflow_dispatchso branch changes can be validated on demandWorst Offender: Windows GitHub Provider ARM64
Baseline run: https://github.com/fdcastel/opkssh/actions/runs/23825106132
Baseline job timings:
Optimized run: https://github.com/fdcastel/opkssh/actions/runs/23827343256
Optimized job timings on the fork:
The root cause is not Go compilation. The ARM64 job spends most of its time installing OpenSSH Server on the runner. In the baseline run,
Install OpenSSH Serveralone took 12m 37s onwindows-11-arm.That means the right optimization is scheduling or scoping that coverage, not micro-optimizing the Go steps.
What Changed
1. Fork pushes now stay on the fast path
Updated workflows:
.github/workflows/ci.yml.github/workflows/gha-windows.ymlChanges:
openpubkey/opksshonmain, or when manually dispatched.2. Workflows only run for relevant changes
Updated workflows:
.github/workflows/build.yml.github/workflows/ci.yml.github/workflows/gha-windows.yml.github/workflows/gha.yml.github/workflows/go.yml.github/workflows/staging.yml.github/workflows/zizmor.ymlChanges:
pathsfilters so docs-only or unrelated changes do not fan out into full CI.zizmornow runs only when workflow automation changes.3. Superseded branch runs are cancelled
Added
concurrencyto:.github/workflows/build.yml.github/workflows/ci.yml.github/workflows/cli-docs.yml.github/workflows/gha-windows.yml.github/workflows/gha.yml.github/workflows/go.yml.github/workflows/release-drafter.yml.github/workflows/staging.yml.github/workflows/zizmor.ymlThis does not make a single run faster, but it removes wasted queue time and stale feedback when pushing multiple times to the same branch.
4. Redundant Go dependency steps were removed
Updated workflows:
.github/workflows/ci.yml.github/workflows/gha-windows.yml.github/workflows/gha.yml.github/workflows/go.ymlChanges:
go mod downloadwhereactions/setup-goalready restores module/build cache or where the actualgo buildorgo teststep will download what it needs.setup-gocaching in the snapshot/release build path by removingcache: falsein.github/workflows/build.ymland.github/workflows/release.yml.5. Upstream-only automation is now explicit
Updated workflows:
.github/workflows/cli-docs.yml.github/workflows/release-drafter.yml.github/workflows/release.yml.github/workflows/staging.ymlChanges:
openpubkey/opkssh.openpubkey/opkssh.openpubkey/opkssh.openpubkey/opkssh.The fork-specific release workflow was already correctly separated in
.github/workflows/release-fork.yml, so it was left unchanged.Official Repo vs Fork Behavior After This Change
Forks like
fdcastel/opksshworkflow_dispatch.zizmorruns only when GitHub Actions automation changes.Official repo
openpubkey/opksshmainand via manual dispatch.mainand via manual dispatch.Remaining Follow-up Ideas
These were not implemented in this branch, but they are the next places to look if more reduction is needed:
mainpush if faster feedback onmainmatters more than immediate ARM validation.