-
Notifications
You must be signed in to change notification settings - Fork 258
116 lines (99 loc) · 4.42 KB
/
DotNetCore_Unit_Tests_Linux.yaml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: build and test .NET Core 9.0 Linux
on:
push:
pull_request:
branches: [ release, development ]
paths:
- '**.cs'
- '**.csproj'
env:
DOTNET_VERSION: '9.0.x' # The .NET SDK version to use
jobs:
build-and-test:
name: build-and-test-linux
runs-on: ubuntu-latest
steps:
- name: Clone webprofusion/certify
uses: actions/checkout@master
with:
path: ./certify
- name: Clone webprofusion/anvil
uses: actions/checkout@master
with:
repository: webprofusion/anvil
ref: refs/heads/main
path: ./libs/anvil
- name: Clone webprofusion/certify-plugins (development branch push)
if: ${{ github.event_name == 'push' && (contains(github.ref_name, '_dev') || github.ref_name == 'development') }}
uses: actions/checkout@master
with:
repository: webprofusion/certify-plugins
ref: refs/heads/development
path: ./certify-plugins
- name: Clone webprofusion/certify-plugins (release branch push)
if: ${{ github.event_name == 'push' && (contains(github.ref_name, '_rel') || github.ref_name == 'release') }}
uses: actions/checkout@master
with:
repository: webprofusion/certify-plugins
ref: refs/heads/release
path: ./certify-plugins
- name: Clone webprofusion/certify-plugins (pull request)
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@master
with:
repository: webprofusion/certify-plugins
ref: ${{ github.base_ref }}
path: ./certify-plugins
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup Step CLI
run: |
wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb
sudo dpkg -i step-cli_0.23.0_amd64.deb
- name: Pull step-ca Docker Image
run: docker pull smallstep/step-ca
- name: Cache NuGet Dependencies
uses: actions/cache@v3
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }}
restore-keys: |
${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget
- name: Install Dependencies & Build Certify.Core.Tests.Unit
run: |
dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.3.8
dotnet add package GitHubActionsTestLogger
dotnet restore -f net9.0
pwd
ls
dotnet build -c Debug -f net9.0 --property WarningLevel=0 /clp:ErrorsOnly
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit
- name: Run Certify.Core.Tests.Unit Tests
run: |
export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify"
export GITHUB_STEP_SUMMARY="./TestResults-${{ runner.os }}/test-summary.md"
dotnet test --no-build -f net9.0 -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace"
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit
- name: Generate Test Results Report
run: |
echo "# Test Results" > $GITHUB_STEP_SUMMARY
sed -i 's/<details>/<details open>/g' ./TestResults-${{ runner.os }}/test-summary.md
cat ./TestResults-${{ runner.os }}/test-summary.md >> $GITHUB_STEP_SUMMARY
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit
if: ${{ always() }}
- name: Generated Test Coverage Report
run: |
reportgenerator -reports:./TestResults-${{ runner.os }}/*/*.cobertura.xml -targetdir:./TestResults-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage"
cat ./TestResults-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit
if: ${{ always() }}
# - name: Upload dotnet test Artifacts
# uses: actions/upload-artifact@master
# with:
# name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }}
# path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/TestResults-9_0-${{ runner.os }}
# # Use always() to always run this step to publish test results when there are test failures
# if: ${{ always() }}