Skip to content

Commit 2ba1f23

Browse files
justin-lovellwassim-k
authored andcommitted
Unit Test project to use different Mongo Versions
By default the test project will use version 8. CI pipeline will run on all supported Mongo versions.
1 parent c4dde10 commit 2ba1f23

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/workflows/default.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ on:
1313

1414
jobs:
1515
build:
16+
name: CI with Mongo ${{ matrix.mongo-version }}
1617
runs-on: ubuntu-latest
1718

19+
strategy:
20+
matrix:
21+
mongo-version: [ "6", "7", "8" ]
22+
1823
steps:
1924
- uses: actions/checkout@v4
2025
with:
@@ -33,7 +38,9 @@ jobs:
3338
- name: Test
3439
run: |
3540
cd UnitTest
36-
dotnet test Orleans.Providers.MongoDB.UnitTest.csproj --configuration Release
41+
dotnet test Orleans.Providers.MongoDB.UnitTest.csproj \
42+
--configuration Release \
43+
-p:MongoVersion=${{ matrix.mongo-version }}
3744
3845
publish:
3946
needs: build

UnitTest/Orleans.Providers.MongoDB.UnitTest.csproj

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,31 @@
66
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
77
<GenerateRuntimeConfigDevFile>true</GenerateRuntimeConfigDevFile>
88
<IsPackable>false</IsPackable>
9+
<MongoVersion Condition="'$(MongoVersion)' == ''">8</MongoVersion>
910
</PropertyGroup>
1011

1112
<ItemGroup>
1213
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
1314
<PackageReference Include="MongoSandbox.Core" Version="2.0.0" />
15+
<PackageReference Include="xunit" Version="2.9.3" />
16+
</ItemGroup>
17+
18+
<ItemGroup Condition="'$(MongoVersion)' == '6'">
19+
<PackageReference Include="MongoSandbox6.runtime.linux-x64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
20+
<PackageReference Include="MongoSandbox6.runtime.osx-arm64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
21+
<PackageReference Include="MongoSandbox6.runtime.win-x64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
22+
</ItemGroup>
23+
24+
<ItemGroup Condition="'$(MongoVersion)' == '7'">
25+
<PackageReference Include="MongoSandbox7.runtime.linux-x64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
26+
<PackageReference Include="MongoSandbox7.runtime.osx-arm64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
27+
<PackageReference Include="MongoSandbox7.runtime.win-x64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
28+
</ItemGroup>
29+
30+
<ItemGroup Condition="'$(MongoVersion)' == '8'">
1431
<PackageReference Include="MongoSandbox8.runtime.linux-x64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
1532
<PackageReference Include="MongoSandbox8.runtime.osx-arm64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
1633
<PackageReference Include="MongoSandbox8.runtime.win-x64" Version="2.0.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
17-
<PackageReference Include="xunit" Version="2.9.3" />
1834
</ItemGroup>
1935

2036
<ItemGroup>

0 commit comments

Comments
 (0)