Fat joins the solution, the CI filter and the release lists #123
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| discover-changes: | |
| name: Discover Changed Projects | |
| runs-on: ubuntu-latest | |
| outputs: | |
| projects: ${{ steps.filter.outputs.changes }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Paths filter | |
| id: filter | |
| uses: dorny/paths-filter@v3.0.2 | |
| with: | |
| list-files: json | |
| filters: | | |
| OutWit.Common: | |
| - 'Common/**' | |
| OutWit.Common.Aspects: | |
| - 'Aspects/**' | |
| - 'Common/**' | |
| OutWit.Common.CommandLine: | |
| - 'CommandLine/**' | |
| OutWit.Common.Logging: | |
| - 'Logging/OutWit.Common.Logging/**' | |
| - 'Logging/OutWit.Common.Logging.Tests/**' | |
| - 'Logging/OutWit.Common.Logging.Abstractions/**' | |
| - 'Aspects/**' | |
| OutWit.Common.Logging.Abstractions: | |
| - 'Logging/OutWit.Common.Logging.Abstractions/**' | |
| OutWit.Common.Rest: | |
| - 'Rest/**' | |
| - 'Common/**' | |
| OutWit.Common.Reflection: | |
| - 'Reflection/**' | |
| OutWit.Common.Proxy: | |
| - 'Proxy/OutWit.Common.Proxy/**' | |
| - 'Proxy/OutWit.Common.Proxy.Tests/**' | |
| - 'Common/**' | |
| OutWit.Common.Proxy.Generator: | |
| - 'Proxy/OutWit.Common.Proxy.Generator/**' | |
| - 'Proxy/OutWit.Common.Proxy.Generator.Tests/**' | |
| - 'Proxy/OutWit.Common.Proxy/**' | |
| OutWit.Common.Json: | |
| - 'Serialization/Json/**' | |
| - 'Aspects/**' | |
| OutWit.Common.MemoryPack: | |
| - 'Serialization/MemoryPack/**' | |
| - 'Aspects/**' | |
| OutWit.Common.MessagePack: | |
| - 'Serialization/MessagePack/**' | |
| - 'Aspects/**' | |
| OutWit.Common.ProtoBuf: | |
| - 'Serialization/ProtoBuf/**' | |
| - 'Aspects/**' | |
| OutWit.Common.MVVM: | |
| - 'MVVM/OutWit.Common.MVVM/**' | |
| - 'MVVM/OutWit.Common.MVVM.Tests/**' | |
| OutWit.Common.MVVM.WPF: | |
| - 'MVVM/OutWit.Common.MVVM.WPF/**' | |
| - 'MVVM/OutWit.Common.MVVM.WPF.Tests/**' | |
| - 'MVVM/OutWit.Common.MVVM.WPF.Generator/**' | |
| - 'MVVM/OutWit.Common.MVVM/**' | |
| OutWit.Common.MVVM.WPF.Generator: | |
| - 'MVVM/OutWit.Common.MVVM.WPF.Generator/**' | |
| OutWit.Common.MVVM.Avalonia: | |
| - 'MVVM/OutWit.Common.MVVM.Avalonia/**' | |
| - 'MVVM/OutWit.Common.MVVM.Avalonia.Tests/**' | |
| - 'MVVM/OutWit.Common.MVVM.Avalonia.Generator/**' | |
| - 'MVVM/OutWit.Common.MVVM/**' | |
| OutWit.Common.MVVM.Avalonia.Generator: | |
| - 'MVVM/OutWit.Common.MVVM.Avalonia.Generator/**' | |
| OutWit.Common.MVVM.Blazor: | |
| - 'MVVM/OutWit.Common.MVVM.Blazor/**' | |
| - 'MVVM/OutWit.Common.MVVM.Blazor.Tests/**' | |
| - 'MVVM/OutWit.Common.MVVM/**' | |
| OutWit.Common.MVVM.Navigation: | |
| - 'MVVM/OutWit.Common.MVVM.Navigation/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Tests/**' | |
| - 'MVVM/OutWit.Common.MVVM/**' | |
| - 'Aspects/**' | |
| OutWit.Common.MVVM.Navigation.Avalonia: | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Avalonia/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Avalonia.Tests/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Avalonia.Sample/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Sample.Module.Avalonia/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Sample.Core/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation/**' | |
| - 'MVVM/OutWit.Common.MVVM.Avalonia/**' | |
| - 'MVVM/OutWit.Common.MVVM.Avalonia.Generator/**' | |
| OutWit.Common.MVVM.Navigation.Avalonia.DialogHost: | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Avalonia.DialogHost/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Avalonia/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation/**' | |
| OutWit.Common.MVVM.Navigation.WPF: | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.WPF/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.WPF.Tests/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.WPF.Sample/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Sample.Module.WPF/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Sample.Core/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation/**' | |
| - 'MVVM/OutWit.Common.MVVM.WPF/**' | |
| - 'MVVM/OutWit.Common.MVVM.WPF.Generator/**' | |
| OutWit.Common.MVVM.Navigation.Modules: | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Modules/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation.Modules.Tests/**' | |
| - 'MVVM/OutWit.Common.MVVM.Navigation/**' | |
| - 'Plugins/OutWit.Common.Plugins/**' | |
| OutWit.Common.NUnit: | |
| - 'NUnit/OutWit.Common.NUnit/**' | |
| OutWit.Common.Platform: | |
| - 'Platform/**' | |
| OutWit.Common.Licensing: | |
| - 'Licensing/**' | |
| - 'Platform/**' | |
| - 'Common/**' | |
| OutWit.Common.Plugins: | |
| - 'Plugins/OutWit.Common.Plugins/**' | |
| - 'Plugins/OutWit.Common.Plugins.Tests/**' | |
| - 'Plugins/OutWit.Common.Plugins.Tests.Mock.*/**' | |
| - 'Plugins/OutWit.Common.Plugins.Abstractions/**' | |
| OutWit.Common.Settings: | |
| - 'Settings/OutWit.Common.Settings/**' | |
| - 'Settings/OutWit.Common.Settings.Tests/**' | |
| OutWit.Common.Settings.Json: | |
| - 'Settings/Json/OutWit.Common.Settings.Json/**' | |
| - 'Settings/Json/OutWit.Common.Settings.Json.Tests/**' | |
| - 'Settings/OutWit.Common.Settings/**' | |
| OutWit.Common.Settings.Csv: | |
| - 'Settings/Csv/OutWit.Common.Settings.Csv/**' | |
| - 'Settings/Csv/OutWit.Common.Settings.Csv.Tests/**' | |
| - 'Settings/OutWit.Common.Settings/**' | |
| OutWit.Common.Settings.Database: | |
| - 'Settings/Database/OutWit.Common.Settings.Database/**' | |
| - 'Settings/Database/OutWit.Common.Settings.Database.Tests/**' | |
| - 'Settings/OutWit.Common.Settings/**' | |
| OutWit.Common.Configuration: | |
| - 'Configuration/**' | |
| OutWit.Common.DependencyInjection: | |
| - 'DependencyInjection/OutWit.Common.DependencyInjection/**' | |
| - 'DependencyInjection/OutWit.Common.DependencyInjection.Tests/**' | |
| - 'DependencyInjection/OutWit.Common.DependencyInjection.Generator/**' | |
| OutWit.Common.DependencyInjection.Generator: | |
| - 'DependencyInjection/OutWit.Common.DependencyInjection.Generator/**' | |
| OutWit.Common.Email: | |
| - 'Email/**' | |
| OutWit.Common.Fat: | |
| - 'Fat/**' | |
| - 'Common/**' | |
| OutWit.Common.Forms: | |
| - 'Forms/**' | |
| - 'Common/**' | |
| - 'Serialization/MemoryPack/**' | |
| - 'Serialization/MessagePack/**' | |
| OutWit.Common.Messenger: | |
| - 'Messenger/**' | |
| OutWit.Common.Logging.Query: | |
| - 'Logging/OutWit.Common.Logging.Query/**' | |
| - 'Logging/OutWit.Common.Logging.Query.Tests/**' | |
| - 'Serialization/MemoryPack/**' | |
| OutWit.Common.Logging.NewRelic: | |
| - 'Logging/OutWit.Common.Logging.NewRelic/**' | |
| - 'Logging/OutWit.Common.Logging.NewRelic.Tests/**' | |
| - 'Logging/OutWit.Common.Logging.Query/**' | |
| - 'Rest/**' | |
| - 'Serialization/MemoryPack/**' | |
| OutWit.Common.Logging.Loki: | |
| - 'Logging/OutWit.Common.Logging.Loki/**' | |
| - 'Logging/OutWit.Common.Logging.Loki.Tests/**' | |
| - 'Logging/OutWit.Common.Logging.Query/**' | |
| run-tests: | |
| name: Test ${{ matrix.project }} | |
| needs: discover-changes | |
| if: needs.discover-changes.outputs.projects != '[]' | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: ${{ fromJson(needs.discover-changes.outputs.projects) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET SDKs (6/7/8/9/10) | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 7.0.x | |
| 8.0.x | |
| 9.0.x | |
| 10.0.x | |
| - name: Cache NuGet | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: nuget-${{ runner.os }}-${{ hashFiles('**/*.slnx', '**/*.csproj') }} | |
| restore-keys: | | |
| nuget-${{ runner.os }}- | |
| - name: Restore | |
| run: dotnet restore OutWit.slnx | |
| - name: Resolve test project path | |
| id: paths | |
| shell: pwsh | |
| run: | | |
| $projName = '${{ matrix.project }}' | |
| $test = Get-ChildItem -Recurse -Filter "$projName.Tests.csproj" | Select-Object -Expand FullName -First 1 | |
| if (!$test) { | |
| Write-Host "No test project for $projName � skipping tests." | |
| "hasTests=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| } else { | |
| "hasTests=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| "testCsproj=$test" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| } | |
| - name: Run tests | |
| if: steps.paths.outputs.hasTests == 'true' | |
| run: dotnet test "${{ steps.paths.outputs.testCsproj }}" --configuration Release --no-restore | |
| # Cross-OS coverage for OutWit.Common.Platform. The package's whole point is | |
| # to expose per-OS probes (Windows / Linux / macOS / Android); the only way | |
| # to know the Linux and macOS code paths are still healthy is to actually | |
| # run them on Linux and macOS runners. Windows is already covered by | |
| # `run-tests` above, so this matrix just adds the other two. | |
| run-platform-multi-os: | |
| name: Platform on ${{ matrix.os }} | |
| needs: discover-changes | |
| if: contains(fromJson(needs.discover-changes.outputs.projects), 'OutWit.Common.Platform') | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET SDKs (6/7/8/9/10) | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 7.0.x | |
| 8.0.x | |
| 9.0.x | |
| 10.0.x | |
| - name: Cache NuGet | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: nuget-${{ runner.os }}-${{ hashFiles('Platform/**/*.csproj') }} | |
| restore-keys: | | |
| nuget-${{ runner.os }}- | |
| - name: Restore | |
| run: dotnet restore Platform/OutWit.Common.Platform.Tests/OutWit.Common.Platform.Tests.csproj | |
| - name: Run tests | |
| run: dotnet test Platform/OutWit.Common.Platform.Tests/OutWit.Common.Platform.Tests.csproj --configuration Release --no-restore |