-
Notifications
You must be signed in to change notification settings - Fork 48
72 lines (62 loc) · 2.49 KB
/
GitHubExt-CI.yml
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
#
# This workflow will build and run all unit tests.
#
name: GitHubExt-CI
on:
pull_request:
push:
branches: [ "main", "feature*" ]
jobs:
build-and-test:
strategy:
matrix:
configuration: [Release, Debug]
platform: [x64, x86, arm64]
os: [windows-latest]
dotnet-version: ['8.0.x']
exclude:
- configuration: Debug
platform: x64
- configuration: Release
platform: x86
- configuration: Debug
platform: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
clean: true
- name: Setup .NET SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.GPR_READ_TOKEN }}
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
with:
vs-version: '17.5'
- name: Download nuget
run: |
mkdir ".\.nuget"
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -OutFile ".\.nuget\nuget.exe"
- name: Find VsDevCmd.bat
run: |
$VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat
if (!$VSDevCmd) { exit 1 }
echo "Using VSDevCmd: ${VSDevCmd}"
Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd"
- name: Restore dependencies
run: dotnet restore GitHubExtension.sln -p:PublishReadyToRun=true
- name: Build_DevHomeGitHubExtension
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=${{ matrix.platform }} /restore GitHubExtension.sln
- name: Find vstest.console.exe
if: ${{ matrix.platform != 'arm64' }}
run: |
$VSDevTestCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -prerelease -products * -find **\TestPlatform\vstest.console.exe
if (!$VSDevTestCmd) { exit 1 }
echo "Using VSDevTestCmd: ${VSDevTestCmd}"
Add-Content $env:GITHUB_ENV "VSDevTestCmd=$VSDevTestCmd"
- name: DevHome UnitTests
if: ${{ matrix.platform != 'arm64' }}
run: cmd /c "$env:VSDevTestCmd" /Platform:${{ matrix.platform }} /TestCaseFilter:"TestCategory!=LiveData" BuildOutput\\${{ matrix.configuration }}\\${{ matrix.platform }}\\GitHubExtension.Test\\GitHubExtension.Test.dll