Repository navigation
86 lines (75 loc) · 2.26 KB
/
Copy pathmsbuild.yml
File metadata and controls
86 lines (75 loc) · 2.26 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
name: MSBuild
on:
push:
paths:
- '**.c'
- '**.cpp'
- '**.cxx'
- '**.h'
- '**.hpp'
- '**.hxx'
- '**.yml'
- '**/premake*.lua'
- 'premake*.lua'
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
paths:
- '**.c'
- '**.cpp'
- '**.cxx'
- '**.h'
- '**.hpp'
- '**.hxx'
- '**.yml'
- '**/premake*.lua'
- 'premake*.lua'
env:
PROJECT_NAME: auto_tests
BUILD_PLATFORM: x64
TESTS: ds_tests ppmem_tests scripting_tests
# Tracy needs SDK 10.0.26100 or newer (RelationProcessorDie, ETW system provider GUIDs);
# it is preinstalled on the windows-2022 runner image
WINSDK_VER: "10.0.26100.0"
permissions:
contents: read
jobs:
build:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
configuration: [ Debug, Release ]
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ACTIONSPAT }}
submodules: recursive
- name: PowerShell Module Cache
uses: potatoqualitee/psmodulecache@v6.2.1
with:
modules-to-cache: 7Zip4PowerShell
- name: Run PS commands
shell: pwsh
run: .\utils\windows_dev_prepare.ps1
- name: Generate Solution
working-directory: ${{env.GITHUB_WORKSPACE}}
run: .\utils\premake5 --file=premake5-tests.lua vs2022
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{matrix.configuration}} /p:Platform=${{env.BUILD_PLATFORM}} build\${{env.PROJECT_NAME}}\${{env.PROJECT_NAME}}.sln
- name: Run tests
working-directory: build\${{env.PROJECT_NAME}}\bin\${{env.BUILD_PLATFORM}}\${{matrix.configuration}}
shell: pwsh
timeout-minutes: 10
run: |
$failed = @()
foreach ($test in $env:TESTS.Split(' ')) {
& ".\$test.exe"
if ($LASTEXITCODE -ne 0) { $failed += $test }
}
if ($failed) { Write-Error "Failed tests: $failed"; exit 1 }