Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 19, 2025

This PR adds a comprehensive Docker-based matrix build workflow that enables automated cross-platform builds for all configurations and architectures.

Changes Made

New Docker Matrix Build Workflow

  • Added .github/workflows/docker-matrix-build.yml that runs on all branches for both push and pull request events
  • Implements a build matrix with 8 combinations:
    • Build Types: Debug, Release, RelWithDebInfo, MinSizeRel
    • Architectures: x86_64-linux-gnu, x86_64-w64-mingw32
  • Each matrix job builds a Docker image and executes the build script with the appropriate parameters

Dockerfile for Consistent Build Environment

  • Created Dockerfile at repository root based on the existing .devcontainer/Dockerfile
  • Uses Debian Trixie with all required build tools (CMake, Ninja, cross-compilation toolchain)
  • Includes both native Linux and MinGW Windows cross-compilation support
  • Provides a consistent, reproducible build environment across all CI runs

Fixed Windows Cross-Compilation Issues

  • Fixed toolchain file: Removed problematic DLL copying from cmake-x86_64-w64-mingw32.cmake that was causing build failures during CMake configuration
  • Enhanced CMakeLists.txt: Added proper conditional logic to copy MinGW runtime DLLs (libstdc++-6.dll, libgcc_s_seh-1.dll) for Windows builds after the build directory is created

Benefits

  • Automated Testing: Every push and PR now automatically builds all 8 configuration combinations
  • Cross-Platform Support: Validates both Linux and Windows builds in the same workflow
  • Consistent Environment: Docker ensures identical build conditions regardless of runner environment
  • Parallel Execution: Matrix strategy allows all builds to run simultaneously, reducing CI time
  • No Branch Restrictions: Workflow runs on all branches, ensuring comprehensive coverage

Validation

All build combinations have been tested successfully:

  • Linux builds produce CppTestApp executable
  • Windows builds produce CppTestApp.exe with required DLLs
  • All CMake build types (Debug, Release, RelWithDebInfo, MinSizeRel) work correctly
  • Docker images build efficiently with proper layer caching

The workflow is ready for immediate use and will provide comprehensive build validation for all future changes.

This pull request was created as a result of the following prompt from Copilot chat.

Add or update the workflow file .github/workflows/docker-matrix-build.yml so that it runs on all branches (no branch filter) for both push and pull_request. For each matrix of config (Debug, Release, RelWithDebInfo, MinSizeRel) and arch (x86_64-linux-gnu, x86_64-w64-mingw32), it should:

  • Build the Docker image from Dockerfile at repo root
  • Run ./scripts/build.sh in a Docker container
  • Upload the build output as an artifact, assuming it's in build/-/

Workflow should use actions/upload-artifact@v4, and not restrict branches.

Example matrix steps:
./scripts/build.sh Debug x86_64-linux-gnu
./scripts/build.sh Release x86_64-linux-gnu
./scripts/build.sh RelWithDebInfo x86_64-linux-gnu
./scripts/build.sh MinSizeRel x86_64-linux-gnu
./scripts/build.sh Debug x86_64-w64-mingw32
./scripts/build.sh Release x86_64-w64-mingw32
./scripts/build.sh RelWithDebInfo x86_64-w64-mingw32
./scripts/build.sh MinSizeRel x86_64-w64-mingw32


💡 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.

Co-authored-by: cracked-machine <7586660+cracked-machine@users.noreply.github.com>
Copilot AI changed the title [WIP] Add workflow to run matrix Docker builds on all branches and upload build artifacts Add Docker matrix build workflow for cross-platform CI/CD Sep 19, 2025
@cracked-machine cracked-machine marked this pull request as ready for review September 19, 2025 16:12
@cracked-machine cracked-machine merged commit c56a449 into main Sep 19, 2025
24 checks passed
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