Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure tests run on ci #305

Merged
merged 8 commits into from
Jul 26, 2024
29 changes: 26 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,18 @@ jobs:
- name: Test on Linux
run: |
. environ
dotnet test --no-restore --no-build -p:ParallelizeAssembly=false --configuration Release -- RunConfiguration.FailWhenNoTestsFound=true
dotnet test --no-restore --no-build -p:ParallelizeAssembly=false --configuration Release --logger:"trx" --results-directory ./test-results
if: matrix.os == 'ubuntu-latest'

- name: Test on Windows
run: dotnet test -a "%UserProfile%\.nuget\packages\nunit3testadapter\4.5.0\build\net462" --no-restore --no-build -p:ParallelizeAssembly=false --configuration Release -- RunConfiguration.FailWhenNoTestsFound=true
run: dotnet test --no-restore --no-build -p:ParallelizeAssembly=false --configuration Release --logger:"trx" --results-directory ./test-results
if: matrix.os != 'ubuntu-latest'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test results (${{ matrix.os }})
path: ./test-results

- name: Package
run: dotnet pack --include-symbols --no-restore --no-build -p:SymbolPackageFormat=snupkg --configuration Release
Expand All @@ -86,8 +92,25 @@ jobs:
run: dotnet nuget push artifacts/*.nupkg -s https://nuget.pkg.github.com/sillsdev/index.json -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate

- name: Publish Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NugetPackages
path: artifacts/*.nupkg
if: github.event_name == 'pull_request'
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: LCM Tests
files: artifacts/**/*.trx
action_fail: true
action_fail_on_inconclusive: true
2 changes: 1 addition & 1 deletion tests/SIL.LCModel.Core.Tests/SIL.LCModel.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This package provides unit tests for SIL.LCModel.Core.</Description>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.2" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="All" />
<PackageReference Include="SIL.TestUtilities" Version="13.0.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.2" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion tests/SIL.LCModel.Tests/SIL.LCModel.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This package provides unit tests for SIL.LCModel.</Description>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.2" />
<PackageReference Include="RhinoMocks" Version="3.6.1" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="All" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/SIL.LCModel.Utils.Tests/SIL.LCModel.Utils.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461</TargetFrameworks>
<TargetFramework>net461</TargetFramework>
<RootNamespace>SIL.LCModel.Utils</RootNamespace>
<Description>The liblcm library is the core FieldWorks model for linguistic analyses of languages. Tools in this library provide the ability to store and interact with language and culture data, including anthropological, text corpus, and linguistics data.
This package provides unit tests for SIL.LCModel.Utils and test utility classes</Description>
Expand All @@ -14,7 +14,7 @@ This package provides unit tests for SIL.LCModel.Utils and test utility classes<
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Mono.Unix" Version="7.1.0-final.1.21458.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.2" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
Loading