Skip to content

HeaderedControls

HeaderedControls #307

Workflow file for this run

# https://docs.github.com/actions/using-workflows/about-workflows
# https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
merge_group:
env:
DOTNET_VERSION: ${{ '6.0.x' }}
ENABLE_DIAGNOSTICS: false
#COREHOST_TRACE: 1
COREHOST_TRACEFILE: corehosttrace.log
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "Xaml-Style-Check"
Xaml-Style-Check:
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
- name: Check XAML Styling
run: powershell -version 5.1 -command "./ApplyXamlStyling.ps1 -Passive" -ErrorAction Stop
# Build both Uno.UI/WinUI2/UWP and Uno.WinUI/WinUI3/WindowsAppSDK versions of our packages using a matrix
build:
needs: [Xaml-Style-Check]
runs-on: windows-latest
# See https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
matrix:
platform: [WinUI2, WinUI3]
env:
MULTI_TARGET_DIRECTORY: tooling/MultiTarget
# faux-ternary expression to select which platforms to build for each platform vs. duplicating step below.
TARGET_PLATFORMS: ${{ matrix.platform != 'WinUI3' && 'all' || 'all-uwp' }}
TEST_PLATFORM: ${{ matrix.platform != 'WinUI3' && 'UWP' || 'WinAppSdk' }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
- name: Run Uno Check to Install Dependencies
run: dotnet tool run uno-check --ci --fix --non-interactive --skip wsl --skip androidemulator --verbose
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
- name: Enable ${{ env.TARGET_PLATFORMS }} TargetFrameworks
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
run: powershell -version 5.1 -command "./UseTargetFrameworks.ps1 ${{ env.TARGET_PLATFORMS }}" -ErrorAction Stop
- name: Generate solution w/ ${{ env.TEST_PLATFORM }} Tests
working-directory: ./
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop
- name: Enable Uno.WinUI (in WinUI3 matrix only)
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
run: powershell -version 5.1 -command "./UseUnoWinUI.ps1 3" -ErrorAction Stop
if: ${{ matrix.platform == 'WinUI3' }}
- name: MSBuild
run: msbuild.exe CommunityToolkit.AllComponents.sln /restore /nowarn:MSB4011 -p:Configuration=Release -m -p:UseDotNetNativeToolchain=false
# Build All Packages
- name: pack experiments
working-directory: ./tooling/Scripts/
run: ./PackEachExperiment.ps1 all
# Push Packages to our DevOps Artifacts Feed (see nuget.config)
- name: Add source
if: ${{ github.ref == 'refs/heads/main' }}
run: dotnet nuget update source MainLatest --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
- name: Push packages
if: ${{ github.ref == 'refs/heads/main' }}
run: dotnet nuget push "**/*.nupkg" --api-key dummy --source MainLatest --skip-duplicate
# Run tests
- name: Setup VSTest Path
uses: darenm/Setup-VSTest@v1
- name: Install Testspace Module
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Run SourceGenerators tests
id: test-generator
run: vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net6.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
- name: Run experiment tests against ${{ env.TEST_PLATFORM }}
id: test-platform
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ env.TEST_PLATFORM }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ env.TEST_PLATFORM }}.trx"
- name: Create test reports
run: |
testspace '[${{ matrix.platform }}]./TestResults/*.trx'
if: ${{ always() && (steps.test-generator.conclusion == 'success' || steps.test-platform.conclusion == 'success') }}
- name: Artifact - Diagnostic Logs
uses: actions/upload-artifact@v3
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: build-logs
path: ./**/*.*log
wasm-linux:
runs-on: ubuntu-latest
env:
HEADS_DIRECTORY: tooling/ProjectHeads
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
- name: Generate solution
shell: pwsh
working-directory: ./
run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
- name: Install ninja for WASM native dependencies
run: sudo apt-get install ninja-build
# Issue with Comment Links currently, see: https://github.com/mrlacey/CommentLinks/issues/38
# See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.App.Wasm.csproj
- name: dotnet build
working-directory: ./${{ env.HEADS_DIRECTORY }}/AllComponents/Wasm/
run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false
# TODO: Do we want to run tests here? Can we do that on linux easily?
- name: Artifact - Diagnostic Logs
uses: actions/upload-artifact@v3
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: linux-logs
path: ./**/*.*log