Skip to content

Keep conversions around a grouping key on the server #2311

Keep conversions around a grouping key on the server

Keep conversions around a grouping key on the server #2311

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
pull_request:
permissions: {}
defaults:
run:
shell: bash
env:
# Test projects requiring SQL Server (run in the sqlserver job, excluded from the main test job)
SQLSERVER_TEST_PROJECTS: >-
test/EFCore.SqlServer.FunctionalTests
test/EFCore.SqlServer.HierarchyId.Tests
test/EFCore.CrossStore.FunctionalTests
test/EFCore.OData.FunctionalTests
test/EFCore.AspNet.SqlServer.FunctionalTests
test/EFCore.VisualBasic.FunctionalTests
test/EFCore.FSharp.FunctionalTests
jobs:
Main:
env:
# Additional projects to exclude (covered by other dedicated jobs, or not directly runnable)
ADDITIONAL_EXCLUDED_PROJECTS: >-
Cosmos.FunctionalTests
Specification.Tests
Microsoft.Data.Sqlite
EFCore.Sqlite
EFCore.AspNet.Sqlite
TrimmingTests
NativeAotTests
ApiBaseline
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025
- os: ubuntu-24.04
- os: macos-15
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Build
if: runner.os != 'Windows'
run: ./build.sh
- name: Build
if: runner.os == 'Windows'
shell: cmd
run: build.cmd
- name: Test
env:
CollectCoverage: true
run: |
mkdir -p artifacts/coverage
pattern=$(echo "$SQLSERVER_TEST_PROJECTS $ADDITIONAL_EXCLUDED_PROJECTS" | xargs -n1 | tr '\n' '|' | sed 's/|$//')
failed=0
for proj in $(find test -maxdepth 2 \( -name '*.csproj' -o -name '*.fsproj' -o -name '*.vbproj' \) \
| grep -v -E "$pattern"); do
dotnet test "$proj" || failed=1
done
exit $failed
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: coverage-main-${{ matrix.os }}
path: artifacts/coverage/*.cobertura.xml
if-no-files-found: ignore
- name: Publish Test Results
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
if: always()
with:
name: test-results-main-${{ matrix.os }}
path: artifacts/log/Debug/*
Cosmos:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025
- os: ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- name: Start Cosmos Emulator
if: runner.os == 'Windows'
shell: powershell
run: |
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
Start-CosmosDbEmulator -Timeout 540 -NoUI -NoTelemetry -NoFirewall -EnablePreview
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Restore
if: runner.os != 'Windows'
run: ./restore.sh
- name: Restore
if: runner.os == 'Windows'
shell: cmd
run: restore.cmd
- name: Test on Cosmos
run: |
mkdir -p artifacts/coverage
dotnet test test/EFCore.Cosmos.FunctionalTests/EFCore.Cosmos.FunctionalTests.csproj
env:
CollectCoverage: true
Test__Cosmos__DefaultConnection: ${{ runner.os == 'Windows' && 'https://localhost:8081' || '' }}
Test__Cosmos__SkipConnectionCheck: ${{ runner.os == 'Windows' && 'true' || '' }}
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: coverage-cosmos-${{ matrix.os }}
path: artifacts/coverage/*.cobertura.xml
if-no-files-found: ignore
- name: Publish Test Results
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
if: always()
with:
name: test-results-cosmos-${{ matrix.os }}
path: artifacts/log/Debug/*
SqlServer:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
sqlserver_version: [2025, 2022, 2019]
env:
MSSQL_SA_PASSWORD: 'PLACEHOLDERPass$$w0rd'
services:
mssql:
image: mcr.microsoft.com/mssql/server:${{ matrix.sqlserver_version }}-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: ${{ env.MSSQL_SA_PASSWORD }}
ports:
- 1433:1433
options: >-
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -Q 'SELECT 1' -C"
--health-start-period=20s
--health-interval=2s
--health-retries=30
--health-timeout=5s
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Restore
run: ./restore.sh
- name: Test on SQL Server
env:
CollectCoverage: true
Test__SqlServer__DefaultConnection: 'Server=localhost;Database=master;User=SA;Password=${{ env.MSSQL_SA_PASSWORD }};Connect Timeout=60;ConnectRetryCount=0;Trust Server Certificate=true'
run: |
mkdir -p artifacts/coverage
failed=0
for proj in $SQLSERVER_TEST_PROJECTS; do
dotnet test "$proj" || failed=1
done
exit $failed
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: coverage-sqlserver-${{ matrix.sqlserver_version }}
path: artifacts/coverage/*.cobertura.xml
if-no-files-found: ignore
- name: Publish Test Results
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
if: always()
with:
name: test-results-sqlserver-${{ matrix.sqlserver_version }}
path: artifacts/log/Debug/*
Sqlite:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025
- os: ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Restore
if: runner.os != 'Windows'
run: ./restore.sh
- name: Restore
if: runner.os == 'Windows'
shell: cmd
run: restore.cmd
- name: Test EF Core Sqlite
env:
CollectCoverage: true
run: |
mkdir -p artifacts/coverage
failed=0
for proj in test/EFCore.Sqlite.FunctionalTests test/EFCore.Sqlite.Tests test/EFCore.AspNet.Sqlite.FunctionalTests; do
dotnet test "$proj" || failed=1
done
exit $failed
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: coverage-sqlite-${{ matrix.os }}
path: artifacts/coverage/*.cobertura.xml
if-no-files-found: ignore
- name: Publish Test Results
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
if: always()
with:
name: test-results-sqlite-${{ matrix.os }}
path: artifacts/log/Debug/*
microsoft-data-sqlite:
name: Microsoft.Data.Sqlite
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025
- os: ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Restore
if: runner.os != 'Windows'
run: ./restore.sh
- name: Restore
if: runner.os == 'Windows'
shell: cmd
run: restore.cmd
- name: Test Microsoft.Data.Sqlite
env:
CollectCoverage: true
run: |
mkdir -p artifacts/coverage
failed=0
for proj in $(find test/Microsoft.Data.Sqlite.Tests -name '*.csproj' \
| if [ "$RUNNER_OS" != "Windows" ]; then grep -v winsqlite3; else cat; fi); do
if dotnet test "$proj"; then
continue
else
test_exit_code=$?
fi
# The SDK aggregate runner reports zero-test exit code 8 after application-level
# ignored exit codes are applied.
if [ "$test_exit_code" -ne 8 ]; then
failed=1
fi
done
exit $failed
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: coverage-microsoft-data-sqlite-${{ matrix.os }}
path: artifacts/coverage/*.cobertura.xml
if-no-files-found: ignore
- name: Publish Test Results
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
if: always()
with:
name: test-results-microsoft-data-sqlite-${{ matrix.os }}
path: artifacts/log/Debug/*
ApiBaselines:
name: API Baselines
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Restore
run: ./restore.sh
- name: Test API Baselines
run: dotnet test test/EFCore.ApiBaseline.Tests
coverage:
name: Upload coverage
needs: [Main, Cosmos, SqlServer, Sqlite, microsoft-data-sqlite]
runs-on: ubuntu-24.04
if: always()
permissions:
contents: read
code-quality: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
sparse-checkout: eng/
- name: Install .NET SDK
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68
with:
dotnet-version: latest
dotnet-quality: ga
- name: Download coverage artifacts
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
pattern: coverage-*
path: artifacts/coverage
- name: Merge coverage reports
shell: pwsh
working-directory: ${{ runner.temp }}
run: . ${{ github.workspace }}/eng/merge-coverage.ps1 -CoverageDirectory ${{ github.workspace }}/artifacts/coverage -OutputFile ${{ github.workspace }}/artifacts/coverage/coverage.cobertura.xml
- name: Upload coverage report
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && hashFiles('artifacts/coverage/coverage.cobertura.xml') != ''
uses: actions/upload-code-coverage@2b21a77928be8d5168c2b9581a67f2adbebacc52
with:
file: artifacts/coverage/coverage.cobertura.xml
language: C#
label: code-coverage
fail-on-error: true