Skip to content

Change to Experimental 2/ Add ForegroundRemover sample #1485

Change to Experimental 2/ Add ForegroundRemover sample

Change to Experimental 2/ Add ForegroundRemover sample #1485

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- 'main'
- 'rel/v**'
- 'dev/**'
pull_request:
branches: [ "main", "dev/**" ]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025
dotnet-arch: 'x64'
dotnet-configuration: 'Release'
- os: windows-11-arm
dotnet-arch: 'arm64'
dotnet-configuration: 'Release'
name: Build MSIX - win-${{ matrix.dotnet-arch }}
runs-on: ${{ matrix.os }}
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: Set LAF build props
shell: pwsh
run: |
if (-not [string]::IsNullOrWhiteSpace("${{ secrets.LAF_TOKEN }}")) {
echo "LAF_TOKEN=${{ secrets.LAF_TOKEN }}" >> $env:GITHUB_ENV
}
if (-not [string]::IsNullOrWhiteSpace("${{ secrets.LAF_PUBLISHER_ID }}")) {
echo "LAF_PUBLISHER_ID=${{ secrets.LAF_PUBLISHER_ID }}" >> $env:GITHUB_ENV
}
- name: Restore dependencies
run: dotnet restore AIDevGallery.sln -r win-${{ matrix.dotnet-arch }} /p:Configuration=${{ matrix.dotnet-configuration }} /p:Platform=${{ matrix.dotnet-arch }} /p:PublishReadyToRun=true /p:SelfContainedIfPreviewWASDK=true
- name: Build
run: |
dotnet build AIDevGallery.Utils --no-restore /p:Configuration=${{ matrix.dotnet-configuration }} /p:LafToken="${{ env.LAF_TOKEN }}" /p:LafPublisherId="${{ env.LAF_PUBLISHER_ID }}"
dotnet build AIDevGallery --no-restore -r win-${{ matrix.dotnet-arch }} -f net9.0-windows10.0.26100.0 /p:Configuration=${{ matrix.dotnet-configuration }} /p:Platform=${{ matrix.dotnet-arch }} /p:AppxPackageDir="AppPackages/" /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxBundle=Never /p:GenerateAppxPackageOnBuild=true /p:SelfContainedIfPreviewWASDK=true /p:LafToken="${{ env.LAF_TOKEN }}" /p:LafPublisherId="${{ env.LAF_PUBLISHER_ID }}"
- 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:
include:
- os: windows-2025
dotnet-arch: 'x64'
dotnet-configuration: 'Release'
- os: windows-11-arm
dotnet-arch: 'arm64'
dotnet-configuration: 'Release'
name: Test - win-${{ matrix.dotnet-arch }}
runs-on: ${{ matrix.os }}
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: Set LAF build props
shell: pwsh
run: |
if (-not [string]::IsNullOrWhiteSpace("${{ secrets.LAF_TOKEN }}")) {
echo "LAF_TOKEN=${{ secrets.LAF_TOKEN }}" >> $env:GITHUB_ENV
}
if (-not [string]::IsNullOrWhiteSpace("${{ secrets.LAF_PUBLISHER_ID }}")) {
echo "LAF_PUBLISHER_ID=${{ secrets.LAF_PUBLISHER_ID }}" >> $env:GITHUB_ENV
}
- name: Restore dependencies
run: dotnet restore AIDevGallery.sln -r win-${{ matrix.dotnet-arch }} /p:Configuration=${{ matrix.dotnet-configuration }} /p:Platform=${{ matrix.dotnet-arch }} /p:PublishReadyToRun=true
- name: Build
run: |
dotnet build AIDevGallery.Utils --no-restore /p:Configuration=${{ matrix.dotnet-configuration }} /p:LafToken="${{ env.LAF_TOKEN }}" /p:LafPublisherId="${{ env.LAF_PUBLISHER_ID }}"
dotnet build AIDevGallery --no-restore -r win-${{ matrix.dotnet-arch }} -f net9.0-windows10.0.26100.0 /p:Configuration=${{ matrix.dotnet-configuration }} /p:Platform=${{ matrix.dotnet-arch }} /p:LafToken="${{ env.LAF_TOKEN }}" /p:LafPublisherId="${{ env.LAF_PUBLISHER_ID }}"
- 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.26100.0 /p:Configuration=${{ matrix.dotnet-configuration }} /p:Platform=${{ matrix.dotnet-arch }}
- name: Run Tests
run: vstest.console.exe .\AIDevGallery.UnitTests\bin\${{ matrix.dotnet-arch }}\${{ matrix.dotnet-configuration }}\net9.0-windows10.0.26100.0\win-${{ matrix.dotnet-arch }}\AIDevGallery.UnitTests.exe /TestAdapterPath:"$HOME\.nuget\mstest.testadapter\3.9.2\buildTransitive\net9.0" /logger:"trx;LogFileName=${{ github.workspace }}\TestResults\VsTestResults.trx"
- name: Publish Test Builds If Failed
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-builds-${{ matrix.dotnet-arch }}
path: |
.\AIDevGallery\bin\${{ matrix.dotnet-arch }}\${{ matrix.dotnet-configuration }}
.\AIDevGallery\obj\${{ matrix.dotnet-arch }}\${{ matrix.dotnet-configuration }}
.\AIDevGallery.UnitTests\bin\${{ matrix.dotnet-arch }}\${{ matrix.dotnet-configuration }}
.\AIDevGallery.UnitTests\obj\${{ matrix.dotnet-arch }}\${{ matrix.dotnet-configuration }}
- name: Publish Test Results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.dotnet-arch }}
path: TestResults