-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.29 KB
/
dotnet-core-multi-os-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
name: .NET Core Test (Multi-OS)
on:
pull_request:
branches: [ main ]
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
BUILD_ARTIFACT_PATH: ${{github.workspace}}/build-artifacts
jobs:
build:
name: Build ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
# If you want to specify a particular version, use this. Otherwise, will use the Runner's installed version
# - name: Setup .NET Core
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 3.1.301
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --logger trx --results-directory ${{env.BUILD_ARTIFACT_PATH}}/test-results/${{matrix.os}}
- name: Publish artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
path: ${{env.BUILD_ARTIFACT_PATH}}