Skip to content

Basic CI/CD#7

Open
johnpatek wants to merge 39 commits intomasterfrom
feature/ci-pipeline
Open

Basic CI/CD#7
johnpatek wants to merge 39 commits intomasterfrom
feature/ci-pipeline

Conversation

@johnpatek
Copy link
Member

Closes #3

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a basic CI/CD pipeline for building the webframe project across Windows, Linux, and macOS platforms. The PR addresses issue #3 by setting up GitHub Actions workflows with vcpkg caching to reduce build times. The changes also remove the qtwebview dependency, which was noted as taking 2-4 hours to build.

Changes:

  • Adds GitHub Actions workflow for multi-platform builds with vcpkg caching support
  • Removes qtwebview dependency from vcpkg.json to reduce build times
  • Adds vcpkg baseline for reproducible dependency versions
  • Creates custom composite actions for vcpkg setup and caching

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
.github/workflows/test.yml Main CI/CD workflow defining build matrix for Windows, Linux, and macOS
.github/cache/action.yml Custom composite action for setting up vcpkg binary cache
.github/vcpkg/action.yml Custom composite action for bootstrapping vcpkg and installing dependencies
.github/vcpkg/setup.py Python script for vcpkg setup (currently incomplete)
vcpkg.json Updated with baseline and removed qtwebview dependency
test/CMakeLists.txt Simplified test directory placeholder message
CMakeLists.txt Removed extra blank line

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +38 to +39
run: ${{matrix.os == 'windows-latest' && 'vcpkg\bootstrap-vcpkg.bat' || './vcpkg/bootstrap-vcpkg.sh'}}

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell command in line 38 is missing spacing around the ternary operator and uses inconsistent path syntax. There should be spaces around '&&' and '||' operators for readability. Also, the command doesn't specify which shell to use, which could cause issues on different operating systems. Consider adding a 'shell' key to this step and using the matrix.shell value like: 'shell: ${{ matrix.shell }}'.

Suggested change
run: ${{matrix.os == 'windows-latest' && 'vcpkg\bootstrap-vcpkg.bat' || './vcpkg/bootstrap-vcpkg.sh'}}
run: ${{ matrix.os == 'windows-latest' && '.\vcpkg\bootstrap-vcpkg.bat' || './vcpkg/bootstrap-vcpkg.sh' }}
shell: ${{ matrix.shell }}

Copilot uses AI. Check for mistakes.
description: "The vcpkg triplet to use"
required: true
shell:
description: "The shell to use for running commands (optional)"
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell input is marked as required, but the description says it's optional. This is inconsistent. If the shell is truly optional, set 'required: false' and provide a default value. If it's required, remove the "(optional)" text from the description.

Suggested change
description: "The shell to use for running commands (optional)"
description: "The shell to use for running commands"

Copilot uses AI. Check for mistakes.

- name: Bootstrap vcpkg
run: ${{matrix.os == 'windows-latest' && 'vcpkg\bootstrap-vcpkg.bat' || './vcpkg/bootstrap-vcpkg.sh'}}

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow is incomplete and doesn't actually build the project. After bootstrapping vcpkg (line 38), there are no subsequent steps to install dependencies using vcpkg, configure the project with CMake, or build the project. This means the workflow will not achieve its stated purpose of building the project on multiple platforms. Additional steps are needed to complete the build process.

Suggested change
- name: Install dependencies with vcpkg
shell: ${{ matrix.shell }}
run: |
./vcpkg/vcpkg install --triplet ${{ matrix.triplet }}
- name: Configure CMake
shell: ${{ matrix.shell }}
run: |
cmake -S . -B build ^
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ^
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
- name: Build
shell: ${{ matrix.shell }}
run: |
cmake --build build --config Release

Copilot uses AI. Check for mistakes.
uses: ./.github/cache
with:
triplet: ${{ matrix.triplet }}
- name: Clone vcpkg
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing shell specification for the 'Clone vcpkg' step. Without an explicit 'shell' key, this step may use different default shells on different platforms, potentially causing inconsistent behavior. Add 'shell: ${{ matrix.shell }}' to ensure consistent shell usage across platforms, similar to the pattern used in the .github/vcpkg/action.yml.

Suggested change
- name: Clone vcpkg
- name: Clone vcpkg
shell: ${{ matrix.shell }}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,15 @@
name: cache
descritpion: Set up cache for vcpkg
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in field name: 'descritpion' should be 'description'.

Suggested change
descritpion: Set up cache for vcpkg
description: Set up cache for vcpkg

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 14
strategy:
fail-fast: false
env:
VCPKG_BINARY_SOURCES: >-
clear;files,${{ github.workspace }}${{ matrix.os == 'windows-latest' && '\vcpkg-cache' || '/vcpkg-cache' }},readwrite
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'env' key is incorrectly placed under 'strategy' at the same level as 'matrix' and 'fail-fast'. Environment variables should be defined at the job level (under 'build:') or at the step level, not under 'strategy'. This syntax error will cause the workflow to fail. Move the 'env' section to the job level, outside of the 'strategy' block.

Suggested change
strategy:
fail-fast: false
env:
VCPKG_BINARY_SOURCES: >-
clear;files,${{ github.workspace }}${{ matrix.os == 'windows-latest' && '\vcpkg-cache' || '/vcpkg-cache' }},readwrite
env:
VCPKG_BINARY_SOURCES: >-
clear;files,${{ github.workspace }}${{ matrix.os == 'windows-latest' && '\vcpkg-cache' || '/vcpkg-cache' }},readwrite
strategy:
fail-fast: false

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +39
- name: Clone vcpkg
run: git clone https://github.com/microsoft/vcpkg

- name: Bootstrap vcpkg
run: ${{matrix.os == 'windows-latest' && 'vcpkg\bootstrap-vcpkg.bat' || './vcpkg/bootstrap-vcpkg.sh'}}

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow references a custom action at './.github/cache' but this action is never actually used in the workflow. Additionally, the workflow manually clones vcpkg and bootstraps it (lines 34-38) instead of using the './.github/vcpkg' action that was created for this purpose. This creates inconsistency and suggests the workflow is incomplete. Either use the custom actions properly or remove them if they're not needed.

Suggested change
- name: Clone vcpkg
run: git clone https://github.com/microsoft/vcpkg
- name: Bootstrap vcpkg
run: ${{matrix.os == 'windows-latest' && 'vcpkg\bootstrap-vcpkg.bat' || './vcpkg/bootstrap-vcpkg.sh'}}
- name: Setup vcpkg
uses: ./.github/vcpkg
with:
triplet: ${{ matrix.triplet }}

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +25
run: python ./.github/vcpkg/setup.py --os ${{ inputs.os }} --triplet ${{ inputs.triplet }}

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vcpkg action clones the vcpkg repository but never uses the vcpkg-root argument from the setup.py script. Additionally, the action doesn't actually install any dependencies - it only clones and bootstraps vcpkg. The action should include a step to install dependencies using 'vcpkg install' with the appropriate triplet and manifest mode. Without this step, the dependencies defined in vcpkg.json will not be installed.

Suggested change
run: python ./.github/vcpkg/setup.py --os ${{ inputs.os }} --triplet ${{ inputs.triplet }}
run: python ./.github/vcpkg/setup.py --os ${{ inputs.os }} --triplet ${{ inputs.triplet }} --vcpkg-root ./vcpkg
- name: Install vcpkg dependencies
shell: ${{ inputs.shell }}
run: ./vcpkg/vcpkg install --triplet ${{ inputs.triplet }}

Copilot uses AI. Check for mistakes.
Comment on lines 13 to 14
VCPKG_BINARY_SOURCES: >-
clear;files,${{ github.workspace }}${{ matrix.os == 'windows-latest' && '\vcpkg-cache' || '/vcpkg-cache' }},readwrite
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VCPKG_BINARY_SOURCES environment variable is defined but will never be set due to the syntax error placing it under 'strategy'. Even if the syntax is corrected, the vcpkg cache directory path is constructed but the directory is never created before vcpkg attempts to use it. Add a step to create the vcpkg-cache directory before running vcpkg commands, for example: 'mkdir -p ${{ github.workspace }}/vcpkg-cache' on Linux/macOS or 'New-Item -ItemType Directory -Force -Path ${{ github.workspace }}\vcpkg-cache' on Windows.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +12

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Setup vcpkg for the project")
parser.add_argument("--vcpkg-root", type=str, default="vcpkg", help="Path to the vcpkg directory")
args = parser.parse_args()


Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup.py script is incomplete and appears to be a stub. It only parses command-line arguments but doesn't implement any actual functionality to bootstrap vcpkg or install dependencies. The script is called from the vcpkg action (line 24 of .github/vcpkg/action.yml) with '--os' and '--triplet' arguments, but the argument parser only accepts '--vcpkg-root'. This mismatch will cause the workflow to fail. The script needs to be completed with the actual vcpkg setup logic.

Suggested change
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Setup vcpkg for the project")
parser.add_argument("--vcpkg-root", type=str, default="vcpkg", help="Path to the vcpkg directory")
args = parser.parse_args()
import os
from pathlib import Path
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Setup vcpkg for the project")
parser.add_argument(
"--vcpkg-root",
type=str,
default="vcpkg",
help="Path to the vcpkg directory",
)
parser.add_argument(
"--os",
dest="os",
choices=["windows", "linux", "macos"],
required=True,
help="Target operating system (determines which bootstrap script to run)",
)
parser.add_argument(
"--triplet",
type=str,
required=True,
help="vcpkg triplet to use when installing dependencies",
)
args = parser.parse_args()
vcpkg_root = Path(args.vcpkg_root).resolve()
if not vcpkg_root.exists():
print(f"[vcpkg-setup] vcpkg root directory does not exist: {vcpkg_root}", file=sys.stderr)
sys.exit(1)
if args.os == "windows":
bootstrap_script_name = "bootstrap-vcpkg.bat"
vcpkg_executable_name = "vcpkg.exe"
use_shell = True
else:
bootstrap_script_name = "bootstrap-vcpkg.sh"
vcpkg_executable_name = "vcpkg"
use_shell = False
bootstrap_script = vcpkg_root / bootstrap_script_name
if not bootstrap_script.exists():
print(f"[vcpkg-setup] Bootstrap script not found: {bootstrap_script}", file=sys.stderr)
sys.exit(1)
print(f"[vcpkg-setup] Bootstrapping vcpkg using {bootstrap_script} ...")
try:
# On Windows, the bootstrap script is a .bat file which typically requires shell=True.
result = subprocess.run(
[str(bootstrap_script)],
cwd=str(vcpkg_root),
shell=use_shell,
check=True,
)
except subprocess.CalledProcessError as exc:
print(f"[vcpkg-setup] vcpkg bootstrap failed with exit code {exc.returncode}", file=sys.stderr)
sys.exit(exc.returncode)
vcpkg_executable = vcpkg_root / vcpkg_executable_name
if not vcpkg_executable.exists():
print(f"[vcpkg-setup] vcpkg executable not found after bootstrap: {vcpkg_executable}", file=sys.stderr)
sys.exit(1)
install_cmd = [str(vcpkg_executable), "install", "--triplet", args.triplet]
print(f"[vcpkg-setup] Running: {' '.join(install_cmd)}")
result = subprocess.run(install_cmd, cwd=os.getcwd())
if result.returncode != 0:
print(f"[vcpkg-setup] vcpkg install failed with exit code {result.returncode}", file=sys.stderr)
sys.exit(result.returncode)
print("[vcpkg-setup] vcpkg setup completed successfully.")

Copilot uses AI. Check for mistakes.
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.

Build Pipeline

1 participant