-
Notifications
You must be signed in to change notification settings - Fork 62
59 lines (45 loc) · 1.73 KB
/
run_unit_tests.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
name: .NET Agent Unit Tests and Code Coverage
on:
push:
branches:
- main # runs after a completed PR to main
pull_request: # runs on a PR to any branch
workflow_dispatch: # allows for manual trigger
env:
DOTNET_NOLOGO: true
NR_DEV_BUILD_HOME: false
# only allow one instance of this workflow to be running per PR or branch, cancels any that are already running
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
run-unit-tests:
name: Run Unit Tests
runs-on: windows-latest
env:
test_results_path: tests\TestResults
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
with:
dotnet-version: 7.x
dotnet-quality: 'ga'
- name: Restore NuGet Packages
run: dotnet restore
- name: Build & Run Unit Tests
run: dotnet test --verbosity minimal --no-restore --settings tests\UnitTests.runsettings --results-directory ${{ env.test_results_path }}
- name: Upload coverage reports to Codecov.io
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
flags: Agent
directory: ${{ env.test_results_path }}
- name: Upload coverage report artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: UnitTestResults # Artifact name
path: ${{ env.test_results_path }} # Directory containing files to upload