-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (79 loc) · 2.45 KB
/
Copy pathbuild.yml
File metadata and controls
98 lines (79 loc) · 2.45 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
name: Build Spectrum
on:
push:
pull_request:
jobs:
build:
runs-on: windows-2025-vs2026
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore vcpkg installed packages
id: vcpkg-cache
uses: actions/cache/restore@v4
with:
path: ./vcpkg_installed
key: vcpkg-v2-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
restore-keys: |
vcpkg-v2-${{ runner.os }}-
- name: Setup project
shell: cmd
run: setup.bat
- name: Generate Visual Studio projects
shell: cmd
run: generate_project.bat
- name: Install vcpkg dependencies
shell: cmd
run: vcpkg install --triplet x64-windows --x-install-root ./vcpkg_installed/x64-windows
- name: Save vcpkg installed packages
if: steps.vcpkg-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ./vcpkg_installed
key: vcpkg-v2-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
- name: Integrate vcpkg with MSBuild
shell: cmd
run: vcpkg integrate install
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Debug vcpkg installed dir
shell: powershell
run: |
msbuild ./projects/modules/modules.vcxproj `
/p:Configuration=Retail /p:Platform=x64 `
/pp:preprocessed.xml
Select-String "_ZVcpkgCurrentInstalledDir" preprocessed.xml | Select-Object -First 5
- name: Build solution
run: msbuild ./projects/spectrum.sln /p:Configuration=Retail /p:Platform=x64 /m /v:minimal
- name: Copy build output to workdir
shell: powershell
run: |
Copy-Item -Path ./bin/Retail/* -Destination ./workdir/ -Recurse -Force
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: build-output
path: ./workdir/
retention-days: 7
test:
runs-on: windows-2025-vs2026
needs: build
steps:
- name: Download build output
uses: actions/download-artifact@v4
with:
name: build-output
path: ./workdir
- name: Run tests
shell: powershell
working-directory: ./workdir
run: |
& ".\test.exe"
exit $LASTEXITCODE