Skip to content

fix: Fix possible concurrency issue with secondary app startup #434

fix: Fix possible concurrency issue with secondary app startup

fix: Fix possible concurrency issue with secondary app startup #434

Workflow file for this run

name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
DotNetVersion: '10.0.100'
UnoCheck_Version: '1.33.1'
jobs:
build:
runs-on: windows-2025
outputs:
semver: ${{ steps.nbgv.outputs.SemVer2 }}
steps:
- uses: actions/checkout@v3
name: Checkout sources
with:
fetch-depth: 0
- name: Install .NET
uses: ./.github/actions/dotnet-install
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: Setup Build Cache
uses: ./.github/actions/cache-setup
with:
uno-check-version: ${{ env.UnoCheck_Version }}
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
id: nbgv
with:
toolVersion: 3.6.139
setAllVars: true
- run: |
npm install -g conventional-changelog-cli@2.2.2
conventional-changelog -p angular -u -r 1 -o "build/changelog.md"
name: 'Generate changelog.md'
- run: |
& dotnet tool update --global uno.check --version $env:UnoCheck_Version --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip androidemulator --skip androidsdk --skip gtk3 --skip xcode --skip vswin --skip vswinworkloads --skip vsmac --skip unosdk --skip dotnetnewunotemplates
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Windows-only Build
run: msbuild -r -v:m src\Uno.UI.RuntimeTests.Engine-win-only-build.slnf
- name: Build
run: |
dotnet build src\Uno.UI.RuntimeTests.Engine-dotnet-build.slnf "/t:Build;Pack" /p:PackageVersion=$env:NBGV_SemVer2 /p:Version=$env:NBGV_SemVer2 "/p:PackageOutputPath=$env:GITHUB_WORKSPACE\artifacts" "/p:PackageReleaseNotesFile=$env:GITHUB_WORKSPACE\build\changelog.md"
- name: Build Summary
run: |
echo "## NuGet Package Summary" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "Package version: ``$env:NBGV_SemVer2``" >> $env:GITHUB_STEP_SUMMARY
- name: Unit Tests
run: |
dotnet test src\Uno.UI.RuntimeTests.Engine.Wasm.Runner.Tests\Uno.UI.RuntimeTests.Engine.Wasm.Runner.Tests.csproj -c Debug --no-build --logger "trx;LogFileName=runner-unit-tests.trx" --results-directory "$env:GITHUB_WORKSPACE\test-results"
- name: Upload Unit Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: UnitTestResults
path: test-results/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet
path: .\artifacts
test:
name: Runtime Tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
name: Checkout sources
with:
fetch-depth: 0
- name: Cleanup Linux
uses: ./.github/actions/cleanup-linux
- name: Install .NET
uses: ./.github/actions/dotnet-install
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: Setup Build Cache
uses: ./.github/actions/cache-setup
with:
uno-check-version: ${{ env.UnoCheck_Version }}
- name: Download NuGet Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: artifacts
- name: Setup local NuGet source
run: |
dotnet nuget add source ${{ github.workspace }}/artifacts --name local
- name: Run uno-check
run: |
dotnet tool install -g uno.check --version ${{ env.UnoCheck_Version }}
uno-check --target linux --fix --non-interactive --ci
- name: Build TestApp (Debug)
run: dotnet build src/TestApp/Uno.UI.RuntimeTests.Engine.TestApp.csproj -c Debug -f net10.0-desktop -p:TargetFrameworksOverride=net10.0-desktop -p:Version=${{ needs.build.outputs.semver }}
- name: Build TestApp (Release)
run: dotnet build src/TestApp/Uno.UI.RuntimeTests.Engine.TestApp.csproj -c Release -f net10.0-desktop -p:TargetFrameworksOverride=net10.0-desktop -p:Version=${{ needs.build.outputs.semver }}
- name: Run Runtime Tests
run: |
mkdir -p test-results
xvfb-run --auto-servernum --server-args='-screen 0 1280x1024x24' \
dotnet src/TestApp/bin/Release/net10.0-desktop/Uno.UI.RuntimeTests.Engine.TestApp.dll
env:
UNO_RUNTIME_TESTS_RUN_TESTS: '{"Filter": {"Value": "!HotReloadTests & !SecondaryAppTests & !Is_SecondaryApp_Supported"}}'
UNO_RUNTIME_TESTS_OUTPUT_PATH: '${{ github.workspace }}/test-results/runtime-tests.xml'
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: TestResults
path: test-results/
- name: Publish Test Results
uses: dorny/test-reporter@a810f9bf83f2344124a920a7a0a85a6716e791f0
if: always()
with:
name: Runtime Tests
path: test-results/runtime-tests.xml
reporter: dotnet-nunit
fail-on-error: true
test-wasm:
name: WASM Runtime Tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
name: Checkout sources
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: Download NuGet Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: artifacts
- name: Setup local NuGet source
run: |
dotnet nuget add source ${{ github.workspace }}/artifacts --name local
- name: Run uno-check
run: |
dotnet tool install -g uno.check --version ${{ env.UnoCheck_Version }}
uno-check --target wasm --fix --non-interactive --ci
- name: Install WASM Runner tool
run: |
dotnet tool install -g Uno.UI.RuntimeTests.Engine.Wasm.Runner --version ${{ needs.build.outputs.semver }}
- name: Install Chromium browser
run: npx playwright install chromium
- name: Build WASM TestApp
run: dotnet publish src/TestApp/Uno.UI.RuntimeTests.Engine.TestApp.csproj -c Release -f net10.0-browserwasm -p:TargetFrameworksOverride=net10.0-browserwasm -p:Version=${{ needs.build.outputs.semver }} -p:PublishTrimmed=false
- name: Run WASM Runtime Tests
run: |
mkdir -p test-results
uno-runtimetests-wasm \
--app-path ./src/TestApp/bin/Release/net10.0-browserwasm/publish/wwwroot \
--output ./test-results/wasm-runtime-tests.xml \
--filter '!HotReloadTests & !SecondaryAppTests & !Is_SecondaryApp_Supported' \
--timeout 600
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: WasmTestResults
path: test-results/
- name: Publish Test Results
uses: dorny/test-reporter@a810f9bf83f2344124a920a7a0a85a6716e791f0
if: always()
with:
name: WASM Runtime Tests
path: test-results/wasm-runtime-tests.xml
reporter: dotnet-nunit
fail-on-error: true
test-wasm-aot-profile:
name: WASM AOT Profile Extraction
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
name: Checkout sources
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: Download NuGet Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: artifacts
- name: Setup local NuGet source
run: |
dotnet nuget add source ${{ github.workspace }}/artifacts --name local
- name: Run uno-check
run: |
dotnet tool install -g uno.check --version ${{ env.UnoCheck_Version }}
uno-check --target wasm --fix --non-interactive --ci
- name: Install WASM Runner tool
run: |
dotnet tool install -g Uno.UI.RuntimeTests.Engine.Wasm.Runner --version ${{ needs.build.outputs.semver }}
- name: Install Chromium browser
run: npx playwright install chromium
- name: Build WASM TestApp with AOT Profiling
run: |
dotnet publish src/TestApp/Uno.UI.RuntimeTests.Engine.TestApp.csproj \
-c Release \
-f net10.0-browserwasm \
-p:TargetFrameworksOverride=net10.0-browserwasm \
-p:Version=${{ needs.build.outputs.semver }} \
-p:PublishTrimmed=false \
-p:WasmShellGenerateAOTProfile=true
- name: Run WASM Tests with AOT Profile Extraction
run: |
mkdir -p test-results
uno-runtimetests-wasm \
--app-path ./src/TestApp/bin/Release/net10.0-browserwasm/publish/wwwroot \
--output ./test-results/wasm-aot-profile-tests.xml \
--aot-profile-output ./test-results/aot.profile \
--filter '!HotReloadTests & !SecondaryAppTests & !Is_SecondaryApp_Supported' \
--timeout 600
- name: Validate AOT Profile
run: |
if [ ! -f ./test-results/aot.profile ]; then
echo "ERROR: AOT profile file was not created"
exit 1
fi
PROFILE_SIZE=$(stat -c%s ./test-results/aot.profile)
echo "AOT profile size: $PROFILE_SIZE bytes"
if [ "$PROFILE_SIZE" -eq 0 ]; then
echo "ERROR: AOT profile file is empty"
exit 1
fi
# Verify the file has the correct AOTPROFILE header
HEADER=$(head -c 10 ./test-results/aot.profile)
if [ "$HEADER" != "AOTPROFILE" ]; then
echo "ERROR: AOT profile file has invalid header"
echo "Expected: AOTPROFILE"
echo "Got: $HEADER"
exit 1
fi
echo "SUCCESS: AOT profile is valid ($PROFILE_SIZE bytes)"
- name: Upload AOT Profile
uses: actions/upload-artifact@v4
if: always()
with:
name: AotProfile
path: test-results/aot.profile
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: WasmAotProfileTestResults
path: test-results/
publish:
name: Publish
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}
runs-on: windows-2025
needs:
- build
- test
- test-wasm
- test-wasm-aot-profile
environment: Publish
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: artifacts
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: 'Az CLI login'
uses: azure/login@v1
with:
allow-no-subscriptions: true
client-id: ${{ secrets.SIGN_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.SIGN_AZURE_TENANT_ID }}
subscription-id: ${{ secrets.SIGN_AZURE_SUBSCRIPTION_ID }}
- name: Sign NuGet packages
shell: pwsh
run: |
dotnet tool install --tool-path . sign --version 0.9.1-beta.25278.1
./sign code azure-key-vault `
artifacts\*.nupkg `
--publisher-name "Uno.UI.RuntimeTests.Engine" `
--description "Uno.UI.RuntimeTests.Engine" `
--description-url "https://github.com/${{ github.repository }}" `
--azure-key-vault-managed-identity true `
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}" `
--azure-key-vault-certificate "${{ secrets.SIGN_KEY_VAULT_CERTIFICATE_ID }}" `
--verbosity information
- name: Upload Signed Packages
uses: actions/upload-artifact@v4
with:
name: NuGet-Signed
path: artifacts
- name: NuGet Push
shell: pwsh
run: |
Get-ChildItem artifacts\*.nupkg -Exclude *.symbols.nupkg,*.snupkg | ForEach-Object {
dotnet nuget push $_.FullName -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_API_KEY }} --skip-duplicate
}