-
Notifications
You must be signed in to change notification settings - Fork 10
96 lines (90 loc) · 3.07 KB
/
command-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
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
name: 'Command: Test'
on:
repository_dispatch:
types: [test-command]
jobs:
pre:
name: Pre-Run
runs-on: ubuntu-latest
steps:
- name: Update comment
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
edit-mode: replace
body: |
🚀 Test run has started.
👉 [Check the output here.](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
test:
name: Test
runs-on: ${{ matrix.os }}
needs: [pre]
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-2022
dotnet:
- net6.0
- net461
exclude:
- os: ubuntu-latest
dotnet: net461
steps:
- uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.client_payload.pull_request.number }}/merge
- name: Run dotnet test
run: dotnet test -c Release -f ${{ matrix.dotnet }}
sonarcloud:
name: Analysis
runs-on: windows-2022
needs: [pre]
steps:
- uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.client_payload.pull_request.number }}/merge
fetch-depth: 0
- uses: actions/setup-java@v1
with:
java-version: '>=11'
- uses: Archomeda/sonarcloud-dotnet-action@v1
with:
ref: refs/pull/${{ github.event.client_payload.pull_request.number }}/merge
sonarToken: ${{ secrets.SONAR_TOKEN }}
sonarOrganization: archomeda-github
sonarProject: Archomeda_Gw2Sharp
sonarAdditionalArgs: /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml /d:sonar.scm.revision=${{ github.event.client_payload.pull_request.head.sha }}
- name: Run dotnet test
run: dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
post-successful:
name: Post-Run successful
runs-on: ubuntu-latest
needs: [test, sonarcloud]
if: success()
steps:
- name: Update comment
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
edit-mode: replace
body: |
✔ Test run was successful.
👉 [Check the output here.](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
reactions: hooray
post-failed:
name: Post-Run failed
runs-on: ubuntu-latest
needs: [test, sonarcloud]
if: failure()
steps:
- name: Update comment
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
edit-mode: replace
body: |
❌ Test run has failed.
👉 [Check the output here.](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
reactions: hooray