-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (71 loc) · 2.28 KB
/
test.yml
File metadata and controls
75 lines (71 loc) · 2.28 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Run Test
on:
workflow_call:
env:
CONFIGURATION: 'Release'
DOTNET_VERSION: '6.0.x'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
${{ env.DOTNET_VERSION }}
3.1.x
- name: Build and Test
run: |
dotnet restore
dotnet build --configuration ${{ env.CONFIGURATION }} --no-restore --verbosity normal --BinaryLogger:./msbuild.binlog
dotnet test --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Upload Coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./test/test-build-tasks/TestResults/*/coverage.cobertura.xml
- name: Upload Build Log
uses: actions/upload-artifact@v3
with:
name: buildlog
path: ./msbuild.${{ matrix.os }}.binlog
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: ./test/test-build-tasks/TestResults/*/coverage.cobertura.xml
test-sample:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Nerdbank.GitVersioning
uses: dotnet/nbgv@v0.4.0
id: nbgv
- name: build test packages
run: |
dotnet pack -o test/build-tasks-sample/artifacts
- name: restore tools
run: |
dotnet tool restore --tool-manifest test/build-tasks-sample/.config/dotnet-tools.json
- name: restore build-tasks-sample
run: |
dotnet restore test/build-tasks-sample/ --disable-build-servers --packages test/build-tasks-sample/package --no-cache /p:NeoTestVersion=${{ steps.nbgv.outputs.NuGetPackageVersion }}
- name: build build-tasks-sample
run: |
dotnet build test/build-tasks-sample/ --no-restore
- name: test build-tasks-sample
run: |
dotnet test test/build-tasks-sample/ --no-build