Skip to content

Commit 18f367f

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 18f367f

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

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

Lines changed: 18 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: ${{ matrix.npgsql-version }}
3637
CrateDB: ${{ matrix.cratedb-version }}
3738
on ${{ matrix.os }}"
3839
runs-on: ${{ matrix.os }}
@@ -44,6 +45,11 @@ jobs:
4445
'8.x',
4546
'9.x',
4647
]
48+
npgsql-version: [
49+
'8.*',
50+
'9.*',
51+
'prerelease',
52+
]
4753
cratedb-version: [ 'nightly' ]
4854

4955
# https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers
@@ -61,9 +67,6 @@ jobs:
6167
- name: Acquire sources
6268
uses: actions/checkout@v5
6369

64-
- name: Set up uv
65-
uses: astral-sh/setup-uv@v7
66-
6770
- name: Set up .NET ${{ matrix.dotnet-version }}
6871
id: dotnet
6972
uses: actions/setup-dotnet@v5
@@ -79,6 +82,16 @@ jobs:
7982
run: |
8083
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json
8184
82-
- name: Validate by-language/csharp-efcore
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-efcore, Npgsql ${{ matrix.npgsql-version }}"
8389
run: |
84-
uv run --with=pueblo ngr test by-language/csharp-efcore --dotnet-version=${{ matrix.dotnet-version }}
90+
cd by-language/csharp-efcore
91+
if [[ "${{ matrix.npgsql-version }}" = "prerelease" ]]; then
92+
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --prerelease
93+
else
94+
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version=${{ matrix.npgsql-version }}
95+
fi
96+
dotnet list package
97+
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)