-
Notifications
You must be signed in to change notification settings - Fork 8
76 lines (66 loc) · 2.57 KB
/
build-and-test.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build and run tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
net:
name: .NET
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
8.0.x
- name: Restore
run: dotnet restore
- name: Build and run tests
run: dotnet test --configuration Release --no-restore --verbosity normal --logger 'trx;LogFilePrefix=test-results'
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: net-test-results-${{ matrix.os }}
path: ${{ github.workspace }}/**/tests/TestResults/*
if-no-files-found: error
net-macos-arm64:
name: .NET macOS ARM64
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
runs-on: ${{ matrix.os }}
env:
DotNetSdkX64: "~/.dotnet-sdk/x64"
DotNetSdkArm64: "~/.dotnet-sdk/arm64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Manually setup .NET 8.0 and 3.1 SDKs
run: >
curl -fsSLO https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh && chmod +x dotnet-install.sh && \
./dotnet-install.sh --architecture arm64 --skip-non-versioned-files --channel 8.0 --install-dir $DotNetSdkArm64 && \
./dotnet-install.sh --architecture x64 --skip-non-versioned-files --channel 3.1 --install-dir $DotNetSdkX64 && \
./dotnet-install.sh --architecture x64 --skip-non-versioned-files --channel 8.0 --install-dir $DotNetSdkX64
- name: Restore
run: $DotNetSdkArm64/dotnet restore
- name: Build and run arm64 tests
run: $DotNetSdkArm64/dotnet test -f net8.0 --configuration Release --no-restore --verbosity normal --logger 'trx;LogFilePrefix=test-results_arm64'
- name: Build and run x64 tests
run: $DotNetSdkX64/dotnet test --configuration Release --no-restore --verbosity normal --logger 'trx;LogFilePrefix=test-results_x64'
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: net-test-results-${{ matrix.os }}
path: ${{ github.workspace }}/**/tests/TestResults/*
if-no-files-found: error