9
9
strategy :
10
10
matrix :
11
11
framework :
12
- - net9.0
13
- - net8.0
14
- - net481
12
+ - 9.0.x
13
+ - 8.0.x
15
14
- net452
16
15
17
16
steps :
21
20
22
21
# 2. Setup .NET SDK (for .NET Core / Modern .NET)
23
22
- name : Setup .NET SDK
24
- if : startsWith(matrix.framework, 'net') && !startsWith(matrix.framework, 'net4')
23
+ if : " ! startsWith(matrix.framework, 'net')"
25
24
uses : actions/setup-dotnet@v4
26
25
with :
27
26
dotnet-version : ${{ matrix.framework }}
@@ -38,16 +37,16 @@ jobs:
38
37
shell : pwsh
39
38
run : |
40
39
Write-Host "🔄 Restoring dependencies for: ${{ matrix.framework }}"
41
- if ("${{ matrix.framework }}" -match "net[5-9]+" ) { dotnet restore }
42
- if ("${{ matrix.framework }}" -match "net[1-4]\d+" ) { nuget.exe restore CloudinaryDotNet.sln }
40
+ if (!startsWith( "${{ matrix.framework }}", "net") ) { dotnet restore }
41
+ if (startsWith( "${{ matrix.framework }}", "net") ) { nuget.exe restore CloudinaryDotNet.sln }
43
42
44
43
# 5. Build Solution
45
44
- name : Build Solution
46
45
shell : pwsh
47
46
run : |
48
47
Write-Host "⚒️ Building for: ${{ matrix.framework }}"
49
- if ("${{ matrix.framework }}" -match "net[5-9]+" ) { dotnet build --configuration Release --no-restore }
50
- if ("${{ matrix.framework }}" -match "net[1-4]\d+" ) { msbuild CloudinaryDotNet.sln /p:Configuration=Release }
48
+ if (!startsWith( "${{ matrix.framework }}", "net") ) { dotnet build --configuration Release --no-restore }
49
+ if (startsWith( "${{ matrix.framework }}", "net") ) { msbuild CloudinaryDotNet.sln /p:Configuration=Release }
51
50
52
51
# 6. Run before_build.ps1
53
52
- name : Run before_build.ps1
@@ -59,13 +58,13 @@ jobs:
59
58
shell : pwsh
60
59
run : |
61
60
Write-Host "🧪 Running Unit Tests for: ${{ matrix.framework }}"
62
- if ("${{ matrix.framework }}" -match "net[5-9]+" ) { dotnet test "./CloudinaryDotNet.Tests/CloudinaryDotNet.Tests.csproj" --configuration Release --no-build }
63
- if ("${{ matrix.framework }}" -match "net[1-4]\d+" ) { vstest.console.exe "./CloudinaryDotNet.Tests/bin/Release/${{ matrix.framework }}/CloudinaryDotNet.Tests.dll" }
61
+ if (!startsWith( "${{ matrix.framework }}", "net") ) { dotnet test "./CloudinaryDotNet.Tests/CloudinaryDotNet.Tests.csproj" --configuration Release --no-build }
62
+ if (startsWith( "${{ matrix.framework }}", "net") ) { vstest.console.exe "./CloudinaryDotNet.Tests/bin/Release/${{ matrix.framework }}/CloudinaryDotNet.Tests.dll" }
64
63
65
64
# 8. Run Integration Tests
66
65
- name : Run Integration Tests
67
66
shell : pwsh
68
67
run : |
69
68
Write-Host "🧪 Running Integration Tests for: ${{ matrix.framework }}"
70
- if ("${{ matrix.framework }}" -match "net[5-9]+" ) { dotnet test "./CloudinaryDotNet.IntegrationTests/CloudinaryDotNet.IntegrationTests.csproj" --configuration Release --no-build }
71
- if ("${{ matrix.framework }}" -match "net[1-4]\d+" ) { vstest.console.exe "./CloudinaryDotNet.IntegrationTests/bin/Release/${{ matrix.framework }}/CloudinaryDotNet.IntegrationTests.dll" }
69
+ if (!startsWith( "${{ matrix.framework }}", "net") ) { dotnet test "./CloudinaryDotNet.IntegrationTests/CloudinaryDotNet.IntegrationTests.csproj" --configuration Release --no-build }
70
+ if (startsWith( "${{ matrix.framework }}", "net") ) { vstest.console.exe "./CloudinaryDotNet.IntegrationTests/bin/Release/${{ matrix.framework }}/CloudinaryDotNet.IntegrationTests.dll" }
0 commit comments