Skip to content

Commit 6a020e9

Browse files
rojiCopilot
andcommitted
Use restore.cmd on Windows (restore.sh doesn't support MINGW)
Co-authored-by: Copilot <[email protected]>
1 parent eb0874a commit 6a020e9

4 files changed

Lines changed: 33 additions & 6 deletions

File tree

.github/workflows/Test.yaml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Build
22

33
on:
44
push:
@@ -30,7 +30,7 @@ env:
3030
test/EFCore.FSharp.FunctionalTests
3131
3232
jobs:
33-
test:
33+
Main:
3434
env:
3535
# Additional projects to exclude (covered by other dedicated jobs, or not directly runnable)
3636
ADDITIONAL_EXCLUDED_PROJECTS: >-
@@ -54,11 +54,17 @@ jobs:
5454
uses: actions/checkout@v6
5555

5656
- name: Restore
57+
if: runner.os != 'Windows'
5758
run: ./restore.sh
5859

60+
- name: Restore
61+
if: runner.os == 'Windows'
62+
shell: cmd
63+
run: restore.cmd
64+
5965
- name: Test
6066
run: |
61-
pattern=$(echo "$SQLSERVER_TEST_PROJECTS $ADDITIONAL_EXCLUDED_PROJECTS" | xargs -n1 | paste -sd'|')
67+
pattern=$(echo "$SQLSERVER_TEST_PROJECTS $ADDITIONAL_EXCLUDED_PROJECTS" | xargs -n1 | tr '\n' '|' | sed 's/|$//')
6268
failed=0
6369
for proj in $(find test -maxdepth 2 \( -name '*.csproj' -o -name '*.fsproj' -o -name '*.vbproj' \) \
6470
| grep -v -E "$pattern"); do
@@ -97,8 +103,14 @@ jobs:
97103
uses: actions/checkout@v6
98104

99105
- name: Restore
106+
if: runner.os != 'Windows'
100107
run: ./restore.sh
101108

109+
- name: Restore
110+
if: runner.os == 'Windows'
111+
shell: cmd
112+
run: restore.cmd
113+
102114
- name: Test on Cosmos
103115
run: dotnet test test/EFCore.Cosmos.FunctionalTests/EFCore.Cosmos.FunctionalTests.csproj
104116
env:
@@ -179,8 +191,14 @@ jobs:
179191
uses: actions/checkout@v6
180192

181193
- name: Restore
194+
if: runner.os != 'Windows'
182195
run: ./restore.sh
183196

197+
- name: Restore
198+
if: runner.os == 'Windows'
199+
shell: cmd
200+
run: restore.cmd
201+
184202
- name: Test EF Core Sqlite
185203
run: |
186204
failed=0
@@ -214,8 +232,14 @@ jobs:
214232
uses: actions/checkout@v6
215233

216234
- name: Restore
235+
if: runner.os != 'Windows'
217236
run: ./restore.sh
218237

238+
- name: Restore
239+
if: runner.os == 'Windows'
240+
shell: cmd
241+
run: restore.cmd
242+
219243
- name: Test Microsoft.Data.Sqlite
220244
run: |
221245
failed=0

test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>$(DefaultNetCoreTargetFramework);$(NetFrameworkCurrent)</TargetFrameworks>
4+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(DefaultNetCoreTargetFramework);$(NetFrameworkCurrent)</TargetFrameworks>
5+
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
56
<DefineConstants>$(DefineConstants);E_SQLITE3</DefineConstants>
67
<Nullable>enable</Nullable>
78
</PropertyGroup>

test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.sqlite3.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>$(DefaultNetCoreTargetFramework);$(NetFrameworkCurrent)</TargetFrameworks>
4+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(DefaultNetCoreTargetFramework);$(NetFrameworkCurrent)</TargetFrameworks>
5+
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
56
<DefineConstants>$(DefineConstants);SQLITE3</DefineConstants>
67
<Nullable>enable</Nullable>
78
</PropertyGroup>

test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.sqlite3mc.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>$(DefaultNetCoreTargetFramework);$(NetFrameworkCurrent)</TargetFrameworks>
4+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(DefaultNetCoreTargetFramework);$(NetFrameworkCurrent)</TargetFrameworks>
5+
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
56
<DefineConstants>$(DefineConstants);SQLITE3MC</DefineConstants>
67
<Nullable>enable</Nullable>
78
</PropertyGroup>

0 commit comments

Comments
 (0)