Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 23, 2025

Problem

GitHub workflows were running dotnet test without the --no-build flag, causing redundant builds that increased CI/CD execution time. Additionally, the pre-release and post-release validation steps in release workflows were not standardized with the ReleasePackageValidation workflow, leading to inconsistent behavior and missing configuration steps. Furthermore, pre-release and post-release validations used separate projects (ReleasePackagesTesting and ReleasePackagesTesting.Published) that essentially performed the same tests, creating unnecessary duplication.

Solution

This PR implements three key improvements:

1. Add --no-build flag to all dotnet test commands

All workflows now follow the explicit build → test pattern:

# Explicit build step
- name: Build solution
  run: |
    dotnet restore solution.sln
    dotnet build solution.sln --configuration Release --no-restore

# Test using built artifacts (no rebuild)
- name: Run tests
  run: |
    dotnet test solution.sln --configuration Release --no-build --verbosity normal

This eliminates redundant builds during the test phase, reducing CI/CD execution time by an estimated 10-20 minutes per full release workflow run.

2. Standardize release validation steps

All release workflows (major, minor, patch) now match the ReleasePackageValidation workflow structure:

Pre-Release Validation:

  • Added system performance configuration (vm.max_map_count, file descriptors)
  • Added Docker environment verification
  • Added explicit build step for ReleasePackagesTesting solution
  • Added proper environment variables (DOTNET_ENVIRONMENT, ASPIRE_ALLOW_UNSECURED_TRANSPORT, DOCKER_HOST)

Post-Release Validation:

  • Added system performance configuration
  • Added Docker environment verification
  • Added explicit build step for ReleasePackagesTesting solution
  • Added proper environment variables

3. Unify pre-release and post-release validation with mode flags

Both pre-release and post-release validation now use the same project (ReleasePackagesTesting/ReleasePackagesTesting.sln) with behavior controlled by the RELEASE_VALIDATION_MODE environment variable:

  • Pre-Release Mode (default): RELEASE_VALIDATION_MODE: "PreRelease"

    • Tests local NuGet packages from ./packages
    • Tests local Docker image loaded from tar.gz
    • Validates artifacts before publishing
  • Post-Release Mode: RELEASE_VALIDATION_MODE: "PostRelease"

    • Tests published NuGet packages from NuGet.org
    • Tests published Docker image from Docker Hub
    • Validates artifacts after publishing

This eliminates the duplicate ReleasePackagesTesting.Published project and reduces maintenance overhead while maintaining the same validation coverage. The entire ReleasePackagesTesting.Published/ folder (29 files) has been removed from the codebase.

Changes

Modified workflows:

  • release-package-validation.yml - Added build step, --no-build flag, and PreRelease mode flag
  • release-major.yml - Standardized validation steps, unified to single project with mode flags, added build steps and --no-build flags
  • release-minor.yml - Standardized validation steps, unified to single project with mode flags, added build steps and --no-build flags
  • release-patch.yml - Standardized validation steps, unified to single project with mode flags, added build steps and --no-build flags
  • learningcourse-integration-tests.yml - Added build step and --no-build flag

Removed:

  • ReleasePackagesTesting.Published/ - Entire folder with 29 files removed (no longer needed)

Updated documentation:

  • docs/RELEASE_PACKAGE_VALIDATION.md - Updated local testing examples to show mode flag usage
  • RELEASE_TESTING.md - Updated to reflect unified validation project with mode flags
  • ReleasePackagesTesting/README.md - Replaced references to Published folder with Validation Modes section

Already correct (no changes):

  • unit-tests.yml
  • backpressure-integration-tests.yml
  • localtesting-integration-tests.yml

Benefits

  • ⚡ Performance: Tests no longer rebuild solutions, saving significant CI/CD time
  • 🔄 Consistency: All release workflows use identical validation structure and the same project
  • 🛡️ Reliability: Build failures are caught at the build step, not during tests
  • 📊 Better Diagnostics: Added Docker and system verification for easier troubleshooting
  • 🧹 Maintainability: Unified validation project eliminates duplication (29 files removed); standardized patterns make workflows easier to understand and update
  • 🎯 Flexibility: Mode controlled by environment variable with sensible default (PreRelease)

Verification

  • ✅ All 13 dotnet test commands now use --no-build flag
  • ✅ All workflows have explicit build steps before test steps
  • ✅ All YAML syntax validated successfully
  • ✅ Build → test sequence is explicit and consistent across all workflows
  • ✅ Both pre and post release validation use same project with mode flags
  • ReleasePackagesTesting.Published/ folder removed (29 files)
  • ✅ Documentation updated to reflect unified approach
  • ✅ No remaining references to removed folder in codebase

Closes #issue_number

Original prompt

@copilot we should run dotnet test —no-build if we have dotnet build before in all GitHub workflows. Adjust prerelease and postrelease validation steps in release workflows to be the same with ReleasePackageValidation workflow.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…alidation steps

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Update release workflows for consistent validation steps Optimize GitHub workflows: Add --no-build flag to dotnet test and standardize release validation steps Oct 23, 2025
@Copilot Copilot AI requested a review from devstress October 23, 2025 17:31
Copilot finished work on behalf of devstress October 23, 2025 17:31
@devstress
Copy link
Owner

@copilot modify both prerelease and post release validation to use the same projects but will run in different mode with different flag. Default should be prerelease.

@devstress
Copy link
Owner

@copilot after modify both prerelease and post release validation to use the same project, you must remove the file system the non used solution and folders.

… validation with mode flags

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
@Copilot
Copy link
Contributor Author

Copilot AI commented Oct 23, 2025

@copilot modify both prerelease and post release validation to use the same projects but will run in different mode with different flag. Default should be prerelease.

Done in commit cceef4a. Both pre-release and post-release validation now use the same project (ReleasePackagesTesting/ReleasePackagesTesting.sln) with the mode controlled by the RELEASE_VALIDATION_MODE environment variable:

  • Pre-Release: RELEASE_VALIDATION_MODE: "PreRelease" (default) - tests local artifacts
  • Post-Release: RELEASE_VALIDATION_MODE: "PostRelease" - tests published artifacts from NuGet.org and Docker Hub

This applies to all three release workflows (major, minor, patch) and the release-package-validation workflow.

@Copilot Copilot AI changed the title Optimize GitHub workflows: Add --no-build flag to dotnet test and standardize release validation steps Optimize GitHub workflows: Add --no-build flag to dotnet test and unify release validation with mode flags Oct 23, 2025
Copilot finished work on behalf of devstress October 23, 2025 18:01
…mentation

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
@Copilot
Copy link
Contributor Author

Copilot AI commented Oct 23, 2025

@copilot after modify both prerelease and post release validation to use the same project, you must remove the file system the non used solution and folders.

Done in commit 0c2359b. Removed the entire ReleasePackagesTesting.Published/ folder (29 files deleted) and updated all documentation:

Removed:

  • ReleasePackagesTesting.Published/ folder with all projects, tests, and configuration files

Updated documentation:

  • docs/RELEASE_PACKAGE_VALIDATION.md - Updated local testing examples to show mode flag usage
  • RELEASE_TESTING.md - Updated to reflect unified validation project
  • ReleasePackagesTesting/README.md - Added "Validation Modes" section explaining PreRelease and PostRelease modes

No references to ReleasePackagesTesting.Published remain in the codebase.

Copilot finished work on behalf of devstress October 23, 2025 18:07
@devstress devstress marked this pull request as ready for review October 23, 2025 18:29
@devstress devstress merged commit 85badb3 into main Oct 23, 2025
3 checks passed
@devstress devstress deleted the copilot/adjust-release-validation-steps branch October 23, 2025 18:29
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.

2 participants