Skip to content

Commit c483007

Browse files
committed
.NET/CI: Improve testing, also against pre-release versions of Npgsql
With the drawback of introducing redundancies by retiring the use of the universal test runner `ngr` in this case, the CI workflow recipe gains the benefit of being able to directly manipulate the version numbers of dependency packages. This improves the setup, because the test suite can now be validated against pre-release versions of the Npgsql package. Npgsql is important for CrateDB, because the .NET connectivity relies on it, provided by its PostgreSQL wire compatibility.
1 parent 0245175 commit c483007

File tree

2 files changed

+38
-11
lines changed

2 files changed

+38
-11
lines changed

.github/workflows/lang-csharp-efcore.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
test:
3434
name: "
3535
.NET: ${{ matrix.dotnet-version }}
36+
Npgsql EF: ${{ matrix.npgsql-version }}
3637
CrateDB: ${{ matrix.cratedb-version }}
3738
on ${{ matrix.os }}"
3839
runs-on: ${{ matrix.os }}
@@ -44,6 +45,14 @@ jobs:
4445
'8.x',
4546
'9.x',
4647
]
48+
npgsql-version: [
49+
'8.*',
50+
'9.*',
51+
# error: NU1202: Package Npgsql.EntityFrameworkCore.PostgreSQL 10.0.0-rc.2
52+
# is not compatible with net9.0 (.NETCoreApp,Version=v9.0).
53+
# Package Npgsql.EntityFrameworkCore.PostgreSQL 10.0.0-rc.2 supports: net10.0
54+
# 'prerelease',
55+
]
4756
cratedb-version: [ 'nightly' ]
4857

4958
# https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers
@@ -61,9 +70,6 @@ jobs:
6170
- name: Acquire sources
6271
uses: actions/checkout@v5
6372

64-
- name: Set up uv
65-
uses: astral-sh/setup-uv@v7
66-
6773
- name: Set up .NET ${{ matrix.dotnet-version }}
6874
id: dotnet
6975
uses: actions/setup-dotnet@v5
@@ -79,6 +85,16 @@ jobs:
7985
run: |
8086
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json
8187
82-
- name: Validate by-language/csharp-efcore
88+
# Propagate the Npgsql version from the test matrix slot value,
89+
# display the current list of packages with versions,
90+
# and invoke the test suite.
91+
- name: "Validate by-language/csharp-efcore, Npgsql ${{ matrix.npgsql-version }}"
8392
run: |
84-
uv run --with=pueblo ngr test by-language/csharp-efcore --dotnet-version=${{ matrix.dotnet-version }}
93+
cd by-language/csharp-efcore
94+
if [[ "${{ matrix.npgsql-version }}" = "prerelease" ]]; then
95+
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --prerelease
96+
else
97+
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version=${{ matrix.npgsql-version }}
98+
fi
99+
dotnet list package
100+
dotnet run test

.github/workflows/lang-csharp-npgsql.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ jobs:
4545
'8.x',
4646
'9.x',
4747
]
48-
npgsql-version: [ '8.0.7', '9.0.3' ]
48+
npgsql-version: [
49+
'8.*',
50+
'9.*',
51+
'prerelease',
52+
]
4953
cratedb-version: [ 'nightly' ]
5054

5155
# https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers
@@ -63,9 +67,6 @@ jobs:
6367
- name: Acquire sources
6468
uses: actions/checkout@v5
6569

66-
- name: Set up uv
67-
uses: astral-sh/setup-uv@v7
68-
6970
- name: Set up .NET ${{ matrix.dotnet-version }}
7071
id: dotnet
7172
uses: actions/setup-dotnet@v5
@@ -81,6 +82,16 @@ jobs:
8182
run: |
8283
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json
8384
84-
- name: Validate by-language/csharp-npgsql, Npgsql ${{ matrix.npgsql-version }}
85+
# Propagate the Npgsql version from the test matrix slot value,
86+
# display the current list of packages with versions,
87+
# and invoke the test suite.
88+
- name: "Validate by-language/csharp-npgsql, Npgsql ${{ matrix.npgsql-version }}"
8589
run: |
86-
uv run --with=pueblo ngr test by-language/csharp-npgsql --dotnet-version=${{ matrix.dotnet-version }} --npgsql-version=${{ matrix.npgsql-version }}
90+
cd by-language/csharp-npgsql
91+
if [[ "${{ matrix.npgsql-version }}" = "prerelease" ]]; then
92+
dotnet add package Npgsql --prerelease
93+
else
94+
dotnet add package Npgsql --version=${{ matrix.npgsql-version }}
95+
fi
96+
dotnet list package
97+
dotnet run test

0 commit comments

Comments
 (0)