Skip to content

Improve CI workflow performance#1261

Open
fdcastel wants to merge 6 commits intoFirebirdSQL:masterfrom
fdcastel:improve-ci-matrix
Open

Improve CI workflow performance#1261
fdcastel wants to merge 6 commits intoFirebirdSQL:masterfrom
fdcastel:improve-ci-matrix

Conversation

@fdcastel
Copy link
Member

Problem

The CI workflow was taking over 40 minutes to complete, with 24 parallel jobs (3 Firebird versions × 8 test suites) each independently building the entire solution, downloading Firebird, and running a single test suite.

Changes

1. Remove unnecessary dotnet clean from build.ps1

On CI with a clean workspace, dotnet clean before dotnet build is redundant.

2. Split into build + test jobs with NuGet cache

  • Single build job builds the solution once, uploads NuGet packages and test binaries as artifacts.
  • Test jobs download pre-built binaries instead of rebuilding from scratch.
  • NuGet package caching (actions/cache) speeds up the build step on subsequent runs.

This eliminates 23 redundant builds that were happening in the original 24-job matrix.

3. Cache Firebird server downloads

  • Modified Prepare() in tests.ps1 to skip download/extract when Firebird is already cached in $firebirdDir.
  • Removed directory deletion from Cleanup() (CI runners are ephemeral, cleanup is unnecessary).
  • Added actions/cache step keyed by Firebird version (firebird-FB30, firebird-FB40, firebird-FB50).

4. Add Tests-FirebirdClient-All grouped test suite

New function in tests.ps1 that runs all 5 FirebirdClient test variants (4 compression/crypt combinations + embedded) in a single invocation. Used for older Firebird versions where individual granularity is less critical.

5. Trim CI matrix from 24 to 13 jobs

Replaced the full 3×8 cross-product matrix with a targeted include list:

Firebird Test Suites Jobs
FB50 (latest) All 8 individual suites 8
FB40 FirebirdClient-All + EFCore + EF6 3
FB30 FirebirdClient-All + EFCore 2

Full test coverage is maintained on the latest Firebird version. Older versions get compatibility spot-checks using the grouped FirebirdClient suite.

6. Update GitHub Actions to Node.js 24-compatible versions

Updated actions that were triggering Node.js 20 deprecation warnings:

  • actions/cache v4 ΓåÆ v5
  • actions/upload-artifact v4 ΓåÆ v7
  • actions/download-artifact v4 ΓåÆ v8

This resolves the warning:

Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: actions/cache@v4, actions/upload-artifact@v4. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026.

Results

Comparison between previous run (before), 1st run (after, cold caches), and 2nd run (after, warm caches):

Before After (cold cache) After (warm cache)
Total jobs 24 14 (1 build + 13 test) 14 (1 build + 13 test)
Wall-clock time ~43 min ~26 min ~29 min
Build job (included in each job) 3m 3s 1m 38s
Deprecation warnings Yes (Node.js 20) Yes (Node.js 20) None

Job timing breakdown

Job 1st run (cold cache) 2nd run (warm cache)
build 3m 3s 1m 38s
test (FB50, FirebirdClient Compression CryptRequired) 7m 49s 4m 50s
test (FB50, FirebirdClient Compression CryptDisabled) 6m 32s 6m 29s
test (FB50, FirebirdClient NoCompression CryptRequired) 5m 38s 5m 25s
test (FB50, FirebirdClient NoCompression CryptDisabled) 5m 25s 5m 46s
test (FB50, FirebirdClient Embedded) 3m 46s 6m 2s
test (FB50, EFCore) 2m 11s 1m 26s
test (FB50, EFCore-Functional) 1m 6s 1m 7s
test (FB50, EF6) 1m 2s 1m 2s
test (FB40, FirebirdClient-All) 21m 16s 26m 21s
test (FB40, EFCore) 1m 28s 1m 15s
test (FB40, EF6) 1m 7s 1m 5s
test (FB30, FirebirdClient-All) 22m 47s 21m 43s
test (FB30, EFCore) 1m 23s 1m 22s

Note: The build job improved from 3m 3s to 1m 38s on the 2nd run thanks to NuGet cache. Firebird cache saves download/extraction time within each test job. Wall-clock time variance between runs is normal due to runner availability and test execution variability.

On CI with a clean workspace, dotnet clean is redundant and wastes time.
- Single build job builds once and uploads artifacts (NuGet packages + test binaries)
- Test jobs download pre-built binaries instead of rebuilding
- Add NuGet package caching to speed up the build step
- Eliminates 23 redundant builds from the 24-job matrix
- Modify Prepare() to skip download/extract when Firebird is already cached
- Remove directory deletion from Cleanup() (CI runners are ephemeral)
- Add actions/cache step keyed by Firebird version
- Saves download and extraction time on cache hits
Runs all 5 FirebirdClient test variants (4 compression/crypt combos + embedded)
in a single invocation, reducing per-job overhead when full granularity is not needed.
- Full coverage (all 8 test suites) on FB50 (latest Firebird)
- Grouped FirebirdClient tests + EFCore + EF6 on FB40
- Grouped FirebirdClient tests + EFCore on FB30
- Uses Tests-FirebirdClient-All for older versions to reduce job count
  while maintaining compatibility coverage
- actions/cache v4 -> v5
- actions/upload-artifact v4 -> v7
- actions/download-artifact v4 -> v8

Fixes Node.js 20 deprecation warnings.
@fdcastel
Copy link
Member Author

As an additional note, if there is interest, I can replace the https://github.com/FirebirdSQL/NETProvider-tests-infrastructure dependency with https://github.com/fdcastel/PSFirebird.

I have kept these scripts up to date, and they can fetch any published Firebird release.

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