-
-
Notifications
You must be signed in to change notification settings - Fork 65
59 lines (49 loc) · 2.04 KB
/
Copy pathdotnet-windows.yml
File metadata and controls
59 lines (49 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Windows / .NET Tests
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
jobs:
dotnet-windows:
runs-on: windows-latest
defaults:
run:
shell: pwsh
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- name: Install LocalDB
run: |
choco install sqllocaldb -y --no-progress
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # need for GitVersion to work properly
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Patch App.config for LocalDB
run: |
$cfg = 'src/DelegateDecompiler.EntityFramework.Tests/App.config'
[xml]$xml = Get-Content $cfg
$cs = $xml.configuration.connectionStrings.add | Where-Object name -eq 'DelegateDecompilerEfTestDb'
$cs.connectionString = 'Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;Integrated Security=True;TrustServerCertificate=True'
$xml.Save($cfg)
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release DelegateDecompiler.sln
- name: Run tests
run: |
$failed = $false
function Fail { $script:failed = $true }
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests || Fail
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests.VB || Fail
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFramework.Tests || Fail
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore8.Tests || Fail
dotnet test --no-build -c Release -f net9.0 src/DelegateDecompiler.EntityFrameworkCore9.Tests || Fail
dotnet test --no-build -c Release -f net10.0 src/DelegateDecompiler.EntityFrameworkCore10.Tests || Fail
if ($failed) { exit 1 }