diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0a0661ca..0897a88f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,8 +60,8 @@ jobs: strategy: fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion. matrix: - winui: [2, 3] # Temporary until we can get Uno/Wasm working - multitarget: ['uwp', 'wasdk'] # Temporary until we can get Uno/Wasm working + winui: [2, 3] + multitarget: ['uwp', 'wasdk', 'wasm', 'wpf', 'linuxgtk', 'macos', 'ios', 'android'] exclude: # WinUI 2 not supported on wasdk - winui: 2 @@ -134,7 +134,42 @@ jobs: # Generate full solution with all projects (sample gallery heads, components, tests) - name: Generate solution with ${{ matrix.multitarget }} gallery, components and tests - run: powershell -version 5.1 -command "./tooling/Build-Toolkit-Components.ps1 -Components DependencyPropertyGenerator -Release -MultiTargets ${{ matrix.multitarget }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop + working-directory: ./ + run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -MultiTargets ${{ matrix.multitarget }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop + + # Build solution + - name: MSBuild (With diagnostics) + if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }} + run: > + msbuild.exe /restore /nowarn:MSB4011 + /p:Configuration=Release + /m + ${{ env.ENABLE_DIAGNOSTICS == 'true' && '/bl' || '' }} + /v:${{ env.MSBUILD_VERBOSITY }} + CommunityToolkit.AllComponents.sln + + - name: MSBuild + if: ${{ env.ENABLE_DIAGNOSTICS == 'false' }} + run: msbuild.exe CommunityToolkit.AllComponents.sln /restore /nowarn:MSB4011 -p:Configuration=Release + + # Run tests + - name: Setup VSTest Path + uses: darenm/setup-vstest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44 + + - name: Install Testspace Module + uses: testspace-com/setup-testspace@v1 + with: + domain: ${{ github.repository_owner }} + + - name: Run component tests against ${{ matrix.multitarget }} + if: ${{ matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk' }} + id: test-platform + run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame + + - name: Create test reports + run: | + testspace '[${{ matrix.multitarget }}]./TestResults/*.trx' + if: ${{ (matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk') && (steps.test-generator.conclusion == 'success' || steps.test-platform.conclusion == 'success') }} - name: Artifact - Diagnostic Logs uses: actions/upload-artifact@v4 @@ -178,7 +213,7 @@ jobs: strategy: fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion. matrix: - winui: [2, 3] # Temporary until we can get Uno/Wasm working + winui: [2, 3] env: VERSION_PROPERTY: ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }} @@ -234,7 +269,7 @@ jobs: # Build and pack component nupkg - name: Build and pack component packages - run: ./tooling/Build-Toolkit-Components.ps1 -Components DependencyPropertyGenerator -MultiTargets uwp,wasdk -ExcludeMultiTargets ${{ env.EXCLUDED_MULTITARGETS }} -WinUIMajorVersion ${{ matrix.winui }} -DateForVersion ${{ env.VERSION_DATE }} ${{ env.VERSION_PROPERTY != '' && format('-PreviewVersion "{0}"', env.VERSION_PROPERTY) || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-EnableBinlogs' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-Verbose' || '' }} -BinlogOutput ./ -NupkgOutput ./ -Release + run: ./tooling/Build-Toolkit-Components.ps1 -MultiTargets all -ExcludeMultiTargets ${{ env.EXCLUDED_MULTITARGETS }} -WinUIMajorVersion ${{ matrix.winui }} -DateForVersion ${{ env.VERSION_DATE }} ${{ env.VERSION_PROPERTY != '' && format('-PreviewVersion "{0}"', env.VERSION_PROPERTY) || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-EnableBinlogs' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-Verbose' || '' }} -BinlogOutput ./ -NupkgOutput ./ -Release - name: Validate package names if: ${{ env.VERSION_PROPERTY != '' }} @@ -271,4 +306,52 @@ jobs: if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }} with: name: build-logs-winui${{ matrix.winui }} - path: ./*.*log \ No newline at end of file + 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@v4 + 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@v4 + 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@v4 + if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }} + with: + name: linux-logs + path: ./**/*.*log \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index a2a397dfa..77e29d5d4 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -26,6 +26,7 @@ + \ No newline at end of file diff --git a/components/AppServices/AppServices.SourceGenerators.Tests/AppServices.SourceGenerators.Tests.csproj b/components/AppServices/AppServices.SourceGenerators.Tests/AppServices.SourceGenerators.Tests.csproj index 3fceba82d..46b9111b5 100644 --- a/components/AppServices/AppServices.SourceGenerators.Tests/AppServices.SourceGenerators.Tests.csproj +++ b/components/AppServices/AppServices.SourceGenerators.Tests/AppServices.SourceGenerators.Tests.csproj @@ -16,4 +16,8 @@ + + + + diff --git a/components/AppServices/CommunityToolkit.AppServices.SourceGenerators/CommunityToolkit.AppServices.SourceGenerators.csproj b/components/AppServices/CommunityToolkit.AppServices.SourceGenerators/CommunityToolkit.AppServices.SourceGenerators.csproj index 78f3c3ccc..64d80c88a 100644 --- a/components/AppServices/CommunityToolkit.AppServices.SourceGenerators/CommunityToolkit.AppServices.SourceGenerators.csproj +++ b/components/AppServices/CommunityToolkit.AppServices.SourceGenerators/CommunityToolkit.AppServices.SourceGenerators.csproj @@ -22,4 +22,9 @@ + + + + + diff --git a/components/AppServices/src/CommunityToolkit.AppServices.csproj b/components/AppServices/src/CommunityToolkit.AppServices.csproj index c7db44f7b..cf4e183b4 100644 --- a/components/AppServices/src/CommunityToolkit.AppServices.csproj +++ b/components/AppServices/src/CommunityToolkit.AppServices.csproj @@ -7,7 +7,6 @@ CommunityToolkit.AppServices $(PackageIdPrefix).$(ToolkitComponentName) false - false @@ -56,4 +55,9 @@ + + + + + diff --git a/components/Extensions.DependencyInjection/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.csproj b/components/Extensions.DependencyInjection/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.csproj new file mode 100644 index 000000000..e80e6cf87 --- /dev/null +++ b/components/Extensions.DependencyInjection/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.csproj @@ -0,0 +1,30 @@ + + + netstandard2.0 + false + true + + + $(NoWarn);CS8500 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/Extensions.DependencyInjection/src/CommunityToolkit.Extensions.DependencyInjection.csproj b/components/Extensions.DependencyInjection/src/CommunityToolkit.Extensions.DependencyInjection.csproj index 4aa44f5af..34c3bb7e4 100644 --- a/components/Extensions.DependencyInjection/src/CommunityToolkit.Extensions.DependencyInjection.csproj +++ b/components/Extensions.DependencyInjection/src/CommunityToolkit.Extensions.DependencyInjection.csproj @@ -30,4 +30,9 @@ + + + + +