Skip to content

Commit 2c15c6d

Browse files
authored
Merge pull request #357 from chrxh/copilot/adapt-ubuntu-ci-yml-for-windows
Add Windows CI workflow for self-hosted runner with CUDA
2 parents 7f96698 + 6024a35 commit 2c15c6d

3 files changed

Lines changed: 61 additions & 32 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
jobs:
2121
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
2222
copilot-setup-steps:
23-
runs-on: self-hosted
23+
runs-on: [self-hosted, Windows]
2424

2525
# Set the permissions to the lowest permissions possible needed for your steps.
2626
# Copilot will be given its own token for its operations.
@@ -36,42 +36,23 @@ jobs:
3636
submodules: recursive
3737

3838
- name: Unshallow vcpkg submodule
39+
shell: pwsh
3940
run: |
4041
cd external/vcpkg
41-
git fetch --unshallow || true
42-
cd ../..
42+
git fetch --unshallow 2>$null; if (-not $?) { Write-Host "Already unshallowed or fetch failed (continuing)" }
43+
exit 0
4344
44-
- name: Install Packages
45-
run: |
46-
sudo apt-get update -qq
47-
sudo apt-get install -y --no-install-recommends libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libgl1-mesa-dev libglu-dev
48-
49-
- name: Install CUDA (via NVIDIA's repo)
50-
run: |
51-
sudo apt-get update
52-
sudo apt-get install -y gnupg software-properties-common wget
53-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
54-
sudo dpkg -i cuda-keyring_1.1-1_all.deb
55-
sudo apt-get update
56-
sudo apt-get install -y cuda-compiler-13-0
57-
58-
- name: Add CUDA to PATH
59-
run: |
60-
echo "/usr/local/cuda/bin" >> $GITHUB_PATH
61-
echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
62-
6345
- name: Bootstrap vcpkg
46+
shell: pwsh
6447
run: |
65-
pushd external/vcpkg
66-
./bootstrap-vcpkg.sh -disableMetrics
67-
popd
48+
Push-Location external/vcpkg
49+
.\bootstrap-vcpkg.bat -disableMetrics
50+
Pop-Location
6851
69-
- name: Configure CMake (mit vcpkg Manifest-Mode)
70-
run: >
71-
cmake -S . -B build
72-
-DCMAKE_TOOLCHAIN_FILE=external/vcpkg/scripts/buildsystems/vcpkg.cmake
73-
-DCMAKE_BUILD_TYPE=Release
74-
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
52+
- name: Configure CMake
53+
shell: pwsh
54+
run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="external\vcpkg\scripts\buildsystems\vcpkg.cmake" -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_CUDA_COMPILER=nvcc
7555

7656
- name: Build
57+
shell: pwsh
7758
run: cmake --build build -j32

.github/workflows/ubuntu-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
1919
# You can convert this to a matrix build if you need cross-platform coverage.
2020
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
21-
runs-on: self-hosted
21+
runs-on: [self-hosted, Linux]
2222

2323
steps:
2424
- uses: actions/checkout@v4

.github/workflows/windows-ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CMake (Windows)
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
pull_request:
7+
branches: [ develop ]
8+
9+
10+
env:
11+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
12+
BUILD_TYPE: Release
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
MCP_AUTH_TOKEN: ${{ secrets.MCP_AUTH_TOKEN }}
15+
16+
jobs:
17+
build:
18+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
19+
# You can convert this to a matrix build if you need cross-platform coverage.
20+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
21+
runs-on: [self-hosted, Windows]
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
28+
- name: Unshallow vcpkg submodule
29+
shell: pwsh
30+
run: |
31+
cd external/vcpkg
32+
git fetch --unshallow 2>$null; if (-not $?) { Write-Host "Already unshallowed or fetch failed (continuing)" }
33+
exit 0
34+
35+
- name: Bootstrap vcpkg
36+
shell: pwsh
37+
run: |
38+
Push-Location external/vcpkg
39+
.\bootstrap-vcpkg.bat -disableMetrics
40+
Pop-Location
41+
42+
- name: Configure CMake
43+
shell: pwsh
44+
run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="external\vcpkg\scripts\buildsystems\vcpkg.cmake" -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_CUDA_COMPILER=nvcc
45+
46+
- name: Build
47+
shell: pwsh
48+
run: cmake --build build -j32

0 commit comments

Comments
 (0)