-
-
Notifications
You must be signed in to change notification settings - Fork 146
114 lines (98 loc) · 3.28 KB
/
Copy pathcmake-clang.yml
File metadata and controls
114 lines (98 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CMake (clang-cl)
on:
push:
paths:
# C/C++ source and headers
- '**/*.cpp'
- '**/*.c'
- '**/*.h'
# Win32 resources
- '**/*.rc'
- '**/*.ico'
- '**/*.manifest'
# Build system
- 'CMakeLists.txt'
- 'cmake/*.cmake'
- 'CMakePresets.json'
- 'CMakeSettings.json'
- 'vcpkg.json'
- 'vcpkg-configuration.json'
- 'vcpkg-overlays/**'
# The workflow itself
- '.github/workflows/cmake-clang.yml'
jobs:
build:
runs-on: windows-2025-vs2026
timeout-minutes: 30
permissions:
contents: write
steps:
# - name: Setup Windows 10 SDK Action
# uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
# with:
# sdk-version: 22621
- name: Checkout repository
uses: actions/checkout@v4
- name: Install LLVM (clang-cl)
run: choco install llvm --no-progress -y
- name: Source vcvars32 (x86)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Cache vcpkg toolchain
id: cache-vcpkg-tool
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg
key: vcpkg-tool-${{ runner.os }}-ce613c41372b23b1f51333815feb3edd87ef8a8b
- name: Install vcpkg
if: steps.cache-vcpkg-tool.outputs.cache-hit != 'true'
shell: bash
env:
VCPKG_COMMIT: ce613c41372b23b1f51333815feb3edd87ef8a8b
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout "$VCPKG_COMMIT"
./bootstrap-vcpkg.bat
- name: Set VCPKG_ROOT
run: |
echo "VCPKG_ROOT=$(Get-Location)\vcpkg" >> $env:GITHUB_ENV
shell: powershell
- name: Restore vcpkg binary cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg-bincache
key: vcpkg-bin-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-overlays/**') }}
restore-keys: |
vcpkg-bin-${{ runner.os }}-
- name: Restore FetchContent cache
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/GWToolboxpp/build-clang/_deps
key: deps-clang-${{ runner.os }}-${{ hashFiles('cmake/*.cmake') }}
restore-keys: |
deps-clang-${{ runner.os }}-
- name: Restore vcpkg installed cache
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/GWToolboxpp/build-clang/vcpkg_installed
key: vcpkg-inst-clang-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/GWToolboxpp/build-clang
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/GWToolboxpp/build-clang
run: cmake $GITHUB_WORKSPACE --preset=clang -DCMAKE_BUILD_TYPE=RelWithDebInfo
env:
VCPKG_ROOT: ${{ env.VCPKG_ROOT }}
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg-bincache,readwrite"
- name: Build
working-directory: ${{runner.workspace}}/GWToolboxpp/build-clang
shell: bash
run: cmake --build .
- name: Save output
uses: actions/upload-artifact@v4
with:
name: GWToolbox-clang-RelWithDebInfo
path: ${{runner.workspace}}/GWToolboxpp/bin/