Improve CI workflow performance#1261
Open
fdcastel wants to merge 6 commits intoFirebirdSQL:masterfrom
Open
Conversation
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.
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. |
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.
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 cleanfrombuild.ps1On CI with a clean workspace,
dotnet cleanbeforedotnet buildis redundant.2. Split into build + test jobs with NuGet cache
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
Prepare()intests.ps1to skip download/extract when Firebird is already cached in$firebirdDir.Cleanup()(CI runners are ephemeral, cleanup is unnecessary).actions/cachestep keyed by Firebird version (firebird-FB30,firebird-FB40,firebird-FB50).4. Add
Tests-FirebirdClient-Allgrouped test suiteNew function in
tests.ps1that 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
includelist: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/cachev4 → v5actions/upload-artifactv4 → v7actions/download-artifactv4 → v8This resolves the warning:
Results
Comparison between previous run (before), 1st run (after, cold caches), and 2nd run (after, warm caches):
Job timing breakdown