-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 1.02 KB
/
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
name: build-and-test
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v4
- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: "6.0.x"
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- run: dotnet restore
- run: dotnet build --configuration Release --no-restore
- run: dotnet test --no-restore --verbosity normal --logger trx --results-directory "testresults"
- uses: actions/upload-artifact@v4
with:
path: testresults
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}