-
Notifications
You must be signed in to change notification settings - Fork 167
127 lines (110 loc) · 4.61 KB
/
github-ci.yml
File metadata and controls
127 lines (110 loc) · 4.61 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
115
116
117
118
119
120
121
122
123
124
125
126
127
# Continuous integration
name: github-continuous-integration
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
# Use VS 2026 preview runner (GA May 4, 2026, then switch to windows-2025)
runs-on: windows-2025-vs2026
permissions:
security-events: write
strategy:
fail-fast: false
matrix:
configuration: [ 'Release', 'Debug', 'Release_Unicode', 'Debug_Unicode' ]
platform: [ 'Win32', 'x64', 'ARM64', 'ARM64EC' ]
exclude:
# ARM64/ARM64EC only need Unicode builds
- platform: ARM64
configuration: Release
- platform: ARM64
configuration: Debug
- platform: ARM64EC
configuration: Release
- platform: ARM64EC
configuration: Debug
steps:
- name: Harden Runner
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: 'recursive'
- name: Install Windows 11 SDK (10.0.22621.0)
shell: pwsh
run: |
& "${{ github.workspace }}\scripts\install-winsdk.ps1"
- name: "Build"
shell: pwsh
run: |
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
$msbuildPath = Join-Path $vsPath "MSBuild\Current\Bin\amd64\msbuild.exe"
& $msbuildPath /m /p:Configuration="${{matrix.configuration}}" /p:Platform="${{matrix.platform}}" mfcmapi.sln
- name: Find vstest.console.exe
if: matrix.platform != 'ARM64' && matrix.platform != 'ARM64EC'
run: |
$VSDevTestCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -prerelease -products * -find Common7\IDE\Extensions\TestPlatform\vstest.console.exe
if (!$VSDevTestCmd) { exit 1 }
echo "Using VSDevTestCmd: ${VSDevTestCmd}"
Add-Content $env:GITHUB_ENV "VSDevTestCmd=$VSDevTestCmd"
- name: MFCMAPI UnitTests
if: matrix.platform != 'ARM64' && matrix.platform != 'ARM64EC'
run: cmd /c "$env:VSDevTestCmd" /Parallel /EnableCodeCoverage /Logger:trx "${{github.workspace}}\\bin\\${{matrix.platform}}\\UnitTest\\${{matrix.configuration}}\\UnitTest.dll"
# - name: Upload Event File
# uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
# with:
# name: Event File (${{ matrix.platform }} - ${{ matrix.configuration }})
# path: ${{ github.event_path }}
- name: Upload Test Result Files
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always() && matrix.platform != 'ARM64' && matrix.platform != 'ARM64EC'
with:
name: Test Results (${{ matrix.platform }} - ${{ matrix.configuration }})
path: ${{github.workspace}}/**/TestResults/**/*
- name: Upload ARM64 Binaries
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: matrix.platform == 'ARM64' && matrix.configuration == 'Release_Unicode'
with:
name: ARM64 Release Binaries
path: |
${{github.workspace}}/bin/ARM64/MFCMapi/Release_Unicode/*.exe
${{github.workspace}}/bin/ARM64/MrMAPI/Release_Unicode/*.exe
- name: Upload ARM64EC Binaries
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: matrix.platform == 'ARM64EC' && matrix.configuration == 'Release_Unicode'
with:
name: ARM64EC Release Binaries
path: |
${{github.workspace}}/bin/ARM64EC/MFCMapi/Release_Unicode/*.exe
${{github.workspace}}/bin/ARM64EC/MrMAPI/Release_Unicode/*.exe
publish-test-results:
name: "Publish Tests Results"
needs: build
runs-on: ubuntu-latest
permissions:
checks: write
# only needed unless run with comment_mode: off
pull-requests: write
security-events: write
if: always()
steps:
- name: Harden Runner
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit
- name: Download Artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0
with:
files: "artifacts/**/*.trx"