@@ -46,14 +46,25 @@ jobs:
4646 run : dotnet build --no-restore -c Release
4747
4848 - name : Test
49- run : >-
50- dotnet test --no-build -c Release
51- --
52- --report-trx --report-trx-filename results.trx
53- --results-directory ./test-results
54- --coverage
55- --coverage-output-format cobertura
56- --coverage-output coverage.xml
49+ # MongoDB integration tests run in the dedicated `mongodb-tests` job —
50+ # list the non-Mongo projects explicitly so Build & Test doesn't need
51+ # Docker or pay the container startup cost on every PR.
52+ run : |
53+ set -e
54+ for proj in \
55+ tests/ExpressiveSharp.Tests \
56+ tests/ExpressiveSharp.IntegrationTests \
57+ tests/ExpressiveSharp.Generator.Tests \
58+ tests/ExpressiveSharp.EntityFrameworkCore.IntegrationTests; do
59+ dotnet test --no-build -c Release \
60+ --project "$proj" \
61+ --results-directory ./test-results \
62+ -- \
63+ --report-trx --report-trx-filename "$(basename "$proj").trx" \
64+ --coverage \
65+ --coverage-output-format cobertura \
66+ --coverage-output "$(basename "$proj").coverage.xml"
67+ done
5768
5869 - name : Upload test results
5970 if : always()
@@ -62,15 +73,15 @@ jobs:
6273 name : test-results
6374 path : |
6475 ./test-results/*.trx
65- ./test-results/**/ coverage.xml
76+ ./test-results/*. coverage.xml
6677 retention-days : 14
6778
6879 - name : Upload coverage to Codecov
6980 if : always()
7081 uses : codecov/codecov-action@v5
7182 with :
7283 token : ${{ secrets.CODECOV_TOKEN }}
73- files : ./test-results/**/ coverage.xml
84+ files : ./test-results/*. coverage.xml
7485 fail_ci_if_error : false
7586
7687 - name : Test report
@@ -187,3 +198,67 @@ jobs:
187198 name : Container Test Results (${{ matrix.database }})
188199 path : ./test-results/*.trx
189200 reporter : dotnet-trx
201+
202+ mongodb-tests :
203+ name : Container Tests (MongoDB)
204+ runs-on : ubuntu-latest
205+ needs : build-and-test
206+ timeout-minutes : 10
207+
208+ env :
209+ CI : true
210+
211+ steps :
212+ - name : Checkout
213+ uses : actions/checkout@v4
214+
215+ - name : Setup .NET SDKs
216+ uses : actions/setup-dotnet@v4
217+ with :
218+ dotnet-version : |
219+ 8.0.x
220+ 9.0.x
221+ 10.0.x
222+
223+ - name : Cache NuGet packages
224+ uses : actions/cache@v4
225+ with :
226+ path : ~/.nuget/packages
227+ key : nuget-${{ runner.os }}-MongoDB-${{ hashFiles('**/*.csproj', 'Directory.Packages.props') }}
228+ restore-keys : |
229+ nuget-${{ runner.os }}-MongoDB-
230+ nuget-${{ runner.os }}-
231+
232+ - name : Restore
233+ run : >-
234+ dotnet restore
235+ tests/ExpressiveSharp.MongoDB.IntegrationTests/ExpressiveSharp.MongoDB.IntegrationTests.csproj
236+
237+ - name : Build
238+ run : >-
239+ dotnet build --no-restore -c Release
240+ tests/ExpressiveSharp.MongoDB.IntegrationTests/ExpressiveSharp.MongoDB.IntegrationTests.csproj
241+
242+ - name : Test
243+ run : >-
244+ dotnet test --no-build -c Release
245+ --project tests/ExpressiveSharp.MongoDB.IntegrationTests
246+ --results-directory ./test-results
247+ --
248+ --report-trx --report-trx-filename results.trx
249+
250+ - name : Upload test results
251+ if : always()
252+ uses : actions/upload-artifact@v4
253+ with :
254+ name : container-test-results-MongoDB
255+ path : ./test-results/*.trx
256+ retention-days : 14
257+
258+ - name : Test report
259+ if : always()
260+ uses : dorny/test-reporter@v1
261+ with :
262+ name : Container Test Results (MongoDB)
263+ path : ./test-results/*.trx
264+ reporter : dotnet-trx
0 commit comments