-
Notifications
You must be signed in to change notification settings - Fork 0
Basic CI/CD #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Basic CI/CD #7
Changes from all commits
af68626
5b5a51d
6595ffc
9b0949d
828da36
5238ae4
b1c22c8
848e102
36347bb
1d41633
3e18612
a741b34
4a2a884
4ff80c3
767ce7a
dad1d68
c591876
3ca92ba
22a7e44
fec4637
caf23e0
85b23d0
00c199e
8e8084f
0fd7eae
55e3cbf
cddea9a
d9a3445
3af8e7a
3904bba
7692f8d
222c5a1
3a1f5a9
026d07b
58e86c5
9d2f3ed
96c2ad3
2091117
b1f60b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| name: cache | ||
| descritpion: Set up cache for vcpkg | ||
| inputs: | ||
| triplet: | ||
| description: "The vcpkg triplet to cache" | ||
| required: true | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Cache vcpkg | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: vcpkg-cache | ||
| key: vcpkg-${{ inputs.triplet }}-${{ hashFiles('vcpkg.json') }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||
| name: vcpkg | ||||||||||||||
| descritpion: Bootstrap and install dependencies with vcpkg | ||||||||||||||
|
||||||||||||||
| descritpion: Bootstrap and install dependencies with vcpkg | |
| description: Bootstrap and install dependencies with vcpkg |
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
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.
| description: "The shell to use for running commands (optional)" | |
| description: "The shell to use for running commands" |
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
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.
| 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 }} |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/usr/bin/env python3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import argparse | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import subprocess | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import sys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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() | |
| 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.") |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,41 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build (${{ matrix.os }}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| include: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - os: windows-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| triplet: x64-windows | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: powershell | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - os: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| triplet: x64-linux | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| triplet: x64-osx | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VCPKG_BINARY_SOURCES: >- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| clear;files,${{ github.workspace }}${{ matrix.os == 'windows-latest' && '\vcpkg-cache' || '/vcpkg-cache' }},readwrite | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Restore vcpkg cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: ./.github/cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| triplet: ${{ matrix.triplet }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Clone vcpkg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Clone vcpkg | |
| - name: Clone vcpkg | |
| shell: ${{ matrix.shell }} |
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
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 }}'.
| 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
AI
Feb 17, 2026
There was a problem hiding this comment.
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.
| - 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
AI
Feb 17, 2026
There was a problem hiding this comment.
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.
| - 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 }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| cmake_minimum_required(VERSION 3.15) | ||
|
|
||
|
|
||
| project(webframe VERSION 0.1.0) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| # Tests for WebFrame | ||
|
|
||
| # Placeholder for tests | ||
| # You can add test executables here using add_executable() and add_test() | ||
|
|
||
| message(STATUS "Test directory - add tests here") | ||
| message(STATUS "Test directory placeholder") |
There was a problem hiding this comment.
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'.