generated from ebekker/pwsh-github-action-base
-
Notifications
You must be signed in to change notification settings - Fork 36
160 lines (146 loc) · 7.03 KB
/
test-action.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: test-action
on:
workflow_dispatch:
inputs:
skip_check_run:
required: false
gist_name:
required: false
set_check_status_from_test_outcome:
required: false
#push:
#release:
# types: published
jobs:
run-tests:
strategy:
matrix:
os:
- 'ubuntu-latest'
- 'windows-latest'
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v1
- name: setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100-preview.7.20366.6'
- name: use this action, default args (missing solution/project paths)
## We expect this one to fail
continue-on-error: true
id: testAction1
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
## This one does not work as expected because
## VSTest logs all projects in a solution to
## the same output file, overwriting the TRX
## each time, so only the last one wins!
## https://github.com/microsoft/vstest/issues/2113
## https://github.com/microsoft/vstest/issues/880
- name: use this action, test solution dir
if: ${{ !cancelled() }}
id: testAction2
uses: ./
with:
project_path: tests
report_name: tests_0_all_in_solution-${{ matrix.os }}
report_title: All Tests In Solution -- Last Project Wins!
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: use this action, xunit project dir
if: ${{ !cancelled() }}
id: testAction3a
uses: ./
with:
project_path: tests/samples.xunit/AssertExamples
report_name: tests_1_xunit-${{ matrix.os }}
report_title: Sample XUnit Tests (${{ matrix.os }})
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: dotnet-tests-report_xunit-${{ matrix.os }}.md
gist_badge_label: 'XUnit Tests: %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}
- name: use this action, xunit project dir no restore no build
if: ${{ !cancelled() }}
id: testAction3a1
uses: ./
with:
project_path: tests/samples.xunit/AssertExamples
report_name: tests_1_xunit-norestore-nobuild-${{ matrix.os }}
report_title: Sample XUnit Tests without build or restore (${{ matrix.os }})
github_token: ${{ secrets.GITHUB_TOKEN }}
no_restore: true
no_build: true
- name: use this action, xunit project dir, ALTERNATE XSL
if: ${{ !cancelled() }}
id: testAction3a2
uses: ./
with:
project_path: tests/samples.xunit/AssertExamples
report_name: tests_1_xunit_altxsl-${{ matrix.os }}
report_title: Sample XUnit Tests (Alt XSL) (${{ matrix.os }})
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: dotnet-tests-report_xunit_altxsl-${{ matrix.os }}.md
gist_badge_label: 'XUnit Tests (Alt XSL): %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}
trx_xsl_path: trx-report/trx2md-alt-sample.xsl
- name: use this action, nunit project dir
if: ${{ !cancelled() }}
id: testAction3b
uses: ./
with:
project_path: tests/nunit-csharp-samples/syntax
report_name: tests_2_nunit-${{ matrix.os }}
report_title: Sample NUnit Tests (${{ matrix.os }})
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: dotnet-tests-report_nunit-${{ matrix.os }}.md
gist_badge_label: 'NUnit Tests: %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}
- name: use this action, mstest project dir
if: ${{ !cancelled() }}
id: testAction3c
uses: ./
with:
project_path: tests/rafaelfgx_DotNetTests/MSTest
report_name: tests_3_mstest-${{ matrix.os }}
report_title: Sample MSTest Tests (${{ matrix.os }})
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: dotnet-tests-report_mstest-${{ matrix.os }}.md
gist_badge_label: 'MSTest Tests: %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}
- name: dump test results
shell: pwsh
run: |
Write-ActionInfo 'Testing on: ${{ matrix.os }}'
Write-ActionInfo ' xUnit:'
Write-ActionInfo ' * result_value = ${{ steps.testAction3a.outputs.result_value }}'
Write-ActionInfo ' * total_count = ${{ steps.testAction3a.outputs.total_count }}'
Write-ActionInfo ' * passed_count = ${{ steps.testAction3a.outputs.passed_count }}'
Write-ActionInfo ' * failed_count = ${{ steps.testAction3a.outputs.failed_count }}'
Write-ActionInfo ' * gist_report_url = ${{ steps.testAction3a.outputs.gist_report_url }}'
Write-ActionInfo ' * gist_badge_url = ${{ steps.testAction3a.outputs.gist_badge_url }}'
Write-ActionInfo ''
Write-ActionInfo ' xUnit (XSL Alt):'
Write-ActionInfo ' * result_value = ${{ steps.testAction3a2.outputs.result_value }}'
Write-ActionInfo ' * total_count = ${{ steps.testAction3a2.outputs.total_count }}'
Write-ActionInfo ' * passed_count = ${{ steps.testAction3a2.outputs.passed_count }}'
Write-ActionInfo ' * failed_count = ${{ steps.testAction3a2.outputs.failed_count }}'
Write-ActionInfo ' * gist_report_url = ${{ steps.testAction3a2.outputs.gist_report_url }}'
Write-ActionInfo ' * gist_badge_url = ${{ steps.testAction3a2.outputs.gist_badge_url }}'
Write-ActionInfo ''
Write-ActionInfo ' NUnit:'
Write-ActionInfo ' * result_value = ${{ steps.testAction3b.outputs.result_value }}'
Write-ActionInfo ' * total_count = ${{ steps.testAction3b.outputs.total_count }}'
Write-ActionInfo ' * passed_count = ${{ steps.testAction3b.outputs.passed_count }}'
Write-ActionInfo ' * failed_count = ${{ steps.testAction3b.outputs.failed_count }}'
Write-ActionInfo ' * gist_report_url = ${{ steps.testAction3b.outputs.gist_report_url }}'
Write-ActionInfo ' * gist_badge_url = ${{ steps.testAction3b.outputs.gist_badge_url }}'
Write-ActionInfo ''
Write-ActionInfo ' MSTest:'
Write-ActionInfo ' * result_value = ${{ steps.testAction3c.outputs.result_value }}'
Write-ActionInfo ' * total_count = ${{ steps.testAction3c.outputs.total_count }}'
Write-ActionInfo ' * passed_count = ${{ steps.testAction3c.outputs.passed_count }}'
Write-ActionInfo ' * failed_count = ${{ steps.testAction3c.outputs.failed_count }}'
Write-ActionInfo ' * gist_report_url = ${{ steps.testAction3c.outputs.gist_report_url }}'
Write-ActionInfo ' * gist_badge_url = ${{ steps.testAction3c.outputs.gist_badge_url }}'
Write-ActionInfo ''