-
Notifications
You must be signed in to change notification settings - Fork 10
56 lines (46 loc) · 1.44 KB
/
ci.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
name: CI
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
env:
solution-path: ./src/HassClient.sln
test-results-path: ./test-results
build-config: Release
strategy:
matrix:
channel:
- stable
steps:
- uses: actions/checkout@v2
- name: Setup .NET 6.0
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
- name: Install trx2junit
run: |
export PATH="$PATH:/root/.dotnet/tools"
dotnet tool install --global trx2junit --version 2.0.0
- name: Restore dependencies
run: dotnet restore ${{env.solution-path}}
- name: Build
run: dotnet build --no-restore --configuration ${{env.build-config}} ${{env.solution-path}}
- name: Test
run: dotnet test --no-build --configuration ${{env.build-config}} --logger "trx" ${{env.solution-path}}
- name: Convert to JUnit format
if: always()
run: |
mkdir ${{env.test-results-path}}
find ./src/ -print \
| grep -i 'TestResults/.*[.]trx' \
| while read filename; \
do cp $filename "${{env.test-results-path}}/$(basename $(dirname $(dirname $filename))).trx"; \
done
trx2junit ${{env.test-results-path}}/*.trx
- name: Publish Unit Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{env.test-results-path}}/*.xml