@@ -30,26 +30,34 @@ jobs:
30
30
with :
31
31
dotnet-version : ${{ matrix.dotnet }}
32
32
33
- - name : Set the TFM for .NET 6.0
34
- if : matrix.dotnet == '6.0.x'
35
- run : echo "DOTNET_TFM=net6.0" >> $GITHUB_ENV
36
-
37
- - name : Set the TFM for .NET 7.0
38
- if : matrix.dotnet == '7.0.x'
39
- run : echo "DOTNET_TFM=net7.0 " >> $GITHUB_ENV
33
+ - name : Set the TFM in Ubuntu
34
+ if : startsWith( matrix.os, 'ubuntu')
35
+ run : |
36
+ VERSION=$(echo "${{ matrix.dotnet }}" | sed 's/[^0-9.]*//g')
37
+ VERSION=$(echo "${VERSION}" | sed 's/\.$//')
38
+ DOTNET_TFM="net${VERSION}"
39
+ echo "DOTNET_TFM=$DOTNET_TFM " >> $GITHUB_ENV
40
40
41
- - name : Set the TFM for .NET 8.0
42
- if : matrix.dotnet == '8.0.x'
43
- run : echo "DOTNET_TFM=net8.0" >> $GITHUB_ENV
41
+ - name : Set the TFM in Windows
42
+ if : startsWith(matrix.os, 'windows')
43
+ run : |
44
+ $VERSION = "${{ matrix.dotnet }}".Substring(0, "${{ matrix.dotnet }}".LastIndexOf('.'))
45
+ $DOTNET_TFM = "net$VERSION"
46
+ echo "DOTNET_TFM=$DOTNET_TFM" | Out-File -FilePath $env:GITHUB_ENV -Append
44
47
45
48
- name : Restore dependencies
46
49
run : dotnet restore
47
50
48
51
- name : Build
49
52
run : dotnet build --no-restore -c Release /p:Version=$VERSION -f ${{ env.DOTNET_TFM }}
50
53
51
- - name : Test
52
- run : dotnet test --no-build --verbosity normal -c Release -f ${{ env.DOTNET_TFM }} /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*"
54
+ - name : Test (Ubuntu)
55
+ if : startsWith(matrix.os, 'ubuntu-latest')
56
+ run : dotnet test --no-build --verbosity normal -c Release -f ${{ env.DOTNET_TFM }} /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*"
57
+
58
+ - name : Test (Windows)
59
+ if : startsWith(matrix.os, 'windows')
60
+ run : dotnet test --no-build --verbosity normal -c Release -f ${{ env.DOTNET_TFM }} --filter DB!=SQLServer
53
61
54
62
- name : Collect to Codecov
55
63
uses : codecov/codecov-action@v3
0 commit comments