Skip to content

Commit 9ac7db0

Browse files
another fix
1 parent 18e4ab2 commit 9ac7db0

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

.github/workflows/test.yaml

+11-12
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ jobs:
99
strategy:
1010
matrix:
1111
framework:
12-
- net9.0
13-
- net8.0
14-
- net481
12+
- 9.0.x
13+
- 8.0.x
1514
- net452
1615

1716
steps:
@@ -21,7 +20,7 @@ jobs:
2120

2221
# 2. Setup .NET SDK (for .NET Core / Modern .NET)
2322
- name: Setup .NET SDK
24-
if: startsWith(matrix.framework, 'net') && !startsWith(matrix.framework, 'net4')
23+
if: "!startsWith(matrix.framework, 'net')"
2524
uses: actions/setup-dotnet@v4
2625
with:
2726
dotnet-version: ${{ matrix.framework }}
@@ -38,16 +37,16 @@ jobs:
3837
shell: pwsh
3938
run: |
4039
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 }
4342
4443
# 5. Build Solution
4544
- name: Build Solution
4645
shell: pwsh
4746
run: |
4847
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 }
5150
5251
# 6. Run before_build.ps1
5352
- name: Run before_build.ps1
@@ -59,13 +58,13 @@ jobs:
5958
shell: pwsh
6059
run: |
6160
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" }
6463
6564
# 8. Run Integration Tests
6665
- name: Run Integration Tests
6766
shell: pwsh
6867
run: |
6968
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

Comments
 (0)