Skip to content

Commit

Permalink
Matrix build by framework (#1362)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmyers authored Nov 12, 2024
1 parent de37405 commit c06c991
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 13 deletions.
54 changes: 41 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@ on:
pull_request:
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
build:
timeout-minutes: 60
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
framework: [net462, net48, net8.0]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.framework }}
cancel-in-progress: true

steps:
- name: Checkout code
Expand All @@ -19,28 +30,45 @@ jobs:
fetch-depth: '0'

- name: Build project
run: dotnet build -bl:build.binlog --configuration Release
run: dotnet build -bl:build.binlog -c Release

- name: Get Path to Tests
run: echo "TEST_PATH=$(dotnet msbuild SIL.Core.Tests/ --getProperty:OutputPath -p:TargetFramework=${{ matrix.framework }} -p:Configuration=Release)" >> $GITHUB_ENV

# there are cases where this will fail and we want to know about it
# so we don't use continue-on-error, but we still want to publish the results
- name: Test project
id: test
run: dotnet test -bl:test.binlog --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results" --results-directory ./test-results
run: dotnet test "$TEST_PATH"/SIL*Tests.dll --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results" --results-directory ./test-results

- name: Publish test results
if: ${{ !cancelled() && steps.test.outcome != 'skipped' }}
uses: EnricoMi/publish-unit-test-result-action/windows@v2
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
check_name: LibPalaso Tests
files: ./test-results/**/*.trx
action_fail: true
action_fail_on_inconclusive: true
name: Test results (${{ matrix.framework }})
path: ./test-results

- name: Publish logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: binary-logs
path: |
build.binlog
test.binlog
name: binary-logs (${{ matrix.framework }})
path: build.binlog

publish-test-results:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Download test results
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: Test results *
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
with:
check_name: Palaso Tests
files: artifacts/**/*.trx
action_fail: true
action_fail_on_inconclusive: true
1 change: 1 addition & 0 deletions SIL.Archiving.Tests/SIL.Archiving.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.Core.Desktop.Tests/SIL.Core.Desktop.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Unit tests for SIL.Core.Desktop</Description>
<IsPackable>false</IsPackable>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.Core.Tests/SIL.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Unit tests for SIL.Core</Description>
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.DblBundle.Tests/SIL.DblBundle.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AssemblyName>SIL.DblBundle.Tests</AssemblyName>
<Description>Unit tests for SIL.DblBundle</Description>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Unit tests for SIL.DictionaryServices</Description>
<IsPackable>false</IsPackable>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.Lexicon.Tests/SIL.Lexicon.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Unit tests for SIL.Lexicon</Description>
<IsPackable>false</IsPackable>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.Lift.Tests/SIL.Lift.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Unit tests for SIL.Lift</Description>
<IsPackable>false</IsPackable>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.Linux.Logging.Tests/SIL.Linux.Logging.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Unit tests for SIL.Linux.Logging</Description>
<IsPackable>false</IsPackable>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.Media.Tests/SIL.Media.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.Scripture.Tests/SIL.Scripture.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AssemblyName>SIL.Scripture.Tests</AssemblyName>
<Description>Unit tests for SIL.Scripture</Description>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.TestUtilities.Tests/SIL.TestUtilities.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Unit tests for SIL.TestUtilities</Description>
<IsPackable>false</IsPackable>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<RootNamespace>SIL.Windows.Forms.Keyboarding.Tests</RootNamespace>
<AssemblyTitle>SIL.Windows.Forms.Keyboarding.Tests</AssemblyTitle>
<Description>Unit tests for SIL.Windows.Forms.Keyboarding</Description>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<IsPackable>false</IsPackable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions SIL.Windows.Forms.Scripture.Tests/VerseControlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void PastedStandardReferenceInTextField()
Assert.AreEqual(32, m_verseCtrl.VerseRef.VerseNum);
}

[Retry(3)]
[TestCase("2 Corinthians 3:18", ExpectedResult = "2CO 3:18")]
[TestCase("2 Corinthians3:18", ExpectedResult = "2CO 3:18")]
[TestCase("2 Corinthians3*18", ExpectedResult = "2CO 3:18")]
Expand Down
1 change: 1 addition & 0 deletions SIL.Windows.Forms.Tests/SIL.Windows.Forms.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<IsPackable>false</IsPackable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit c06c991

Please sign in to comment.