Below is a “delta” style review – only the places where you can gain real, measurable time or reliability are touched.
Everything else is already quite lean.
────────────────────────────────────────────────────────
- Skip the whole job when nothing changed
(saves 30-60 s of runner time on every Monday)
jobs:
build_if_new_commits:
runs-on: windows-2025
if: |
github.event_name == 'workflow_dispatch' ||
(vars[env.GITHUB_VARIABLE_NAME] != github.event.repository.updated_at)
The expression is evaluated before the runner is allocated, so you do not even spin up a VM when the SHA is unchanged.
(You still need the SHA comparison inside the job to update the variable, but the early-exit avoids the checkout and all other steps.)
────────────────────────────────────────────────────────
2. Cache the source tree as well as Cygwin
- name: Cache Corretto source + Cygwin
if: steps.check_build_condition.outputs.needs_build == 'true'
uses: actions/cache@v4
with:
path: |
C:\cygwin64
${{ env.CORRETTO_SOURCE_DIR }}/.git
key: ${{ runner.os }}-cygwin-src-${{ hashFiles('**/configure*', '**/make/**') }}
- The
.git folder is cached so the next shallow clone becomes a local fetch (≈ 1-2 s instead of 30-40 s).
- The cache key includes the configure script and make files; if they change the cache is invalidated automatically.
────────────────────────────────────────────────────────
3. Use the built-in Cygwin that ships with the runner
(saves 3-4 min of choco install)
windows-2025 images already contain Cygwin in C:\cygwin64.
You only need to install the extra packages:
- name: Install missing Cygwin packages
if: steps.check_build_condition.outputs.needs_build == 'true'
run: |
C:\cygwin64\cygwinsetup.exe -q -P ${{ env.CYGWIN_PACKAGES }}
shell: cmd
No Chocolatey, no cache key for the whole Cygwin tree – just the package list.
────────────────────────────────────────────────────────
4. Parallelise the build more aggressively
make JOBS=$NUMBER_OF_PROCESSORS images
$NUMBER_OF_PROCESSORS is a Windows env-var already set to the logical core count; you can use it directly in PowerShell:
- name: Build Corretto
if: steps.check_build_condition.outputs.needs_build == 'true'
working-directory: ${{ env.CORRETTO_SOURCE_DIR }}
run: |
C:\cygwin64\bin\bash -lc "make JOBS=$NUMBER_OF_PROCESSORS images"