-
Notifications
You must be signed in to change notification settings - Fork 22
102 lines (100 loc) · 4.32 KB
/
build.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
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
name: CI
on:
workflow_dispatch:
push:
branches:
- 'main'
- 'rel/v**'
- 'dev/**'
pull_request:
branches: [ "main", "dev/**" ]
jobs:
build:
strategy:
fail-fast: false
matrix:
dotnet-configuration: [ 'Release' ]
dotnet-arch: ['x64' ] # TODO: enable when Microsoft.ML.OnnxRuntimeGenAI 0.4.0 ships to NuGet.org, 'arm64' ]
name: Build MSIX - win-${{ matrix.dotnet-arch }}
runs-on: windows-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install NBGV tool
run: dotnet tool install --tool-path . nbgv
- name: Set Version
run: ./nbgv cloud -c
- name: Update Package Manifest Version
run: |
$manifestPath = "${{ github.workspace }}\AIDevGallery\Package.appxmanifest"
[xml]$manifest = get-content $manifestPath
$manifest.Package.Identity.Version = '${{ env.GitBuildVersionSimple }}.0'
$manifest.Save($manifestPath)
- name: Restore dependencies
run: dotnet restore AIDevGallery.sln -r win-${{ matrix.dotnet-arch }} /p:Configuration=Release /p:Platform=${{ matrix.dotnet-arch }} /p:PublishReadyToRun=true
- name: Build
run: |
dotnet build AIDevGallery.Utils --no-restore /p:Configuration=Release
dotnet build AIDevGallery --no-restore -r win-${{ matrix.dotnet-arch }} -f net9.0-windows10.0.22621.0 /p:Configuration=Release /p:Platform=${{ matrix.dotnet-arch }} /p:AppxPackageDir="AppPackages/" /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxBundle=Never /p:GenerateAppxPackageOnBuild=true
- name: Upload Artifact - MSIX
uses: actions/upload-artifact@v4
with:
name: MSIX-${{ matrix.dotnet-arch }}
path: ${{ github.workspace }}/AIDevGallery/AppPackages/*_${{ matrix.dotnet-arch }}_Test/AIDevGallery_*_${{ matrix.dotnet-arch }}.msix
test:
strategy:
fail-fast: false
matrix:
dotnet-configuration: [ 'Release' ]
dotnet-arch: ['x64' ] # TODO: enable when Microsoft.ML.OnnxRuntimeGenAI 0.4.0 ships to NuGet.org, 'arm64' ]
name: Test - win-${{ matrix.dotnet-arch }}
runs-on: windows-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install NBGV tool
run: dotnet tool install --tool-path . nbgv
- name: Set Version
run: ./nbgv cloud -c
- name: Update Package Manifest Version
run: |
$manifestPath = "${{ github.workspace }}\AIDevGallery\Package.appxmanifest"
[xml]$manifest = get-content $manifestPath
$manifest.Package.Identity.Version = '${{ env.GitBuildVersionSimple }}.0'
$manifest.Save($manifestPath)
- name: Restore dependencies
run: dotnet restore AIDevGallery.sln -r win-${{ matrix.dotnet-arch }} /p:Configuration=Release /p:Platform=${{ matrix.dotnet-arch }} /p:PublishReadyToRun=true
- name: Build
run: |
dotnet build AIDevGallery.Utils --no-restore /p:Configuration=Release
dotnet build AIDevGallery --no-restore -r win-${{ matrix.dotnet-arch }} -f net9.0-windows10.0.22621.0 /p:Configuration=Release /p:Platform=${{ matrix.dotnet-arch }}
- name: Setup Dev Tools
uses: ilammy/msvc-dev-cmd@v1
- name: Build Tests
run: dotnet build AIDevGallery.UnitTests -r win-${{ matrix.dotnet-arch }} -f net9.0-windows10.0.22621.0 /p:Configuration=Release /p:Platform=${{ matrix.dotnet-arch }}
- name: Run Tests
run: vstest.console.exe .\AIDevGallery.UnitTests\bin\${{ matrix.dotnet-arch }}\Release\net9.0-windows10.0.22621.0\win-${{ matrix.dotnet-arch }}\AIDevGallery.UnitTests.build.appxrecipe /TestAdapterPath:"$HOME\.nuget\mstest.testadapter\3.6.1\build\net9.0" /framework:FrameworkUap10 /logger:"trx;LogFileName=${{ github.workspace }}\TestResults\VsTestResults.trx"
- name: Publish Test Results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.dotnet-arch }}
path: TestResults