-
Notifications
You must be signed in to change notification settings - Fork 11
121 lines (121 loc) · 3.97 KB
/
release.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
name: Release
on: push
jobs:
test-defaults:
runs-on: ubuntu-18.04
name: Default version uses timestamps and package can be installed
steps:
- uses: actions/checkout@v1
- id: xunit-viewer
uses: ./ #use the current project relative to root
- name: The generated report
run: echo "The report is ${{ steps.xunit-viewer.outputs.report-file }}"
- name: Test
run: |
[ ${{ steps.xunit-viewer.outputs.report-file }} == "test-reports/index.html" ]
- name: Attach the report
if: always()
uses: actions/upload-artifact@v1
with:
name: test-reports
path: ${{ steps.xunit-viewer.outputs.report-dir }}
test-alternate-results-path:
runs-on: ubuntu-18.04
name: Report is generated in alternate xml results path.
env:
RESULTS_PATH: alternate-location
steps:
- uses: actions/checkout@v1
- name: Generate Report
id: xunit-viewer
uses: ./ #use the current project relative to root
with:
results: ${{ env.RESULTS_PATH }}
- name: The generated report
run: echo "The report is ${{ steps.xunit-viewer.outputs.report-file }}"
- name: Test
run: |
[ ${{ steps.xunit-viewer.outputs.report-file }} == "${{ env.RESULTS_PATH }}/index.html" ]
- name: Attach the report
if: always()
uses: actions/upload-artifact@v1
with:
name: alternate-results-path-reports
path: ${{ steps.xunit-viewer.outputs.report-dir }}
test-alternate-report-path:
runs-on: ubuntu-18.04
name: Report is generated at provided location.
steps:
- uses: actions/checkout@v1
- name: Generate Report
id: xunit-viewer
with:
output: somewhere/custom-report.html
uses: ./ #use the current project relative to root
- name: The generated report
run: echo "The report is ${{ steps.xunit-viewer.outputs.report-file }}"
- name: Test
run: |
[ ${{ steps.xunit-viewer.outputs.report-file }} == "somewhere/custom-report.html" ]
- name: Attach the report
if: always()
uses: actions/upload-artifact@v1
with:
name: alternate-report-path-reports
path: somewhere/custom-report.html
test-show-failure:
runs-on: ubuntu-18.04
continue-on-error: true
name: Demonstrates failure case
steps:
- uses: actions/checkout@v1
- id: xunit-viewer
uses: ./ #use the current project relative to root
with:
results: test/failure
- name: Attach the report
if: always()
uses: actions/upload-artifact@v1
with:
name: ${{ steps.xunit-viewer.outputs.report-name }}
path: ${{ steps.xunit-viewer.outputs.report-dir }}
test-ignore-failure:
runs-on: ubuntu-18.04
name: Demonstrates failure is not reported
steps:
- uses: actions/checkout@v1
- id: xunit-viewer
uses: ./ #use the current project relative to root
with:
results: test/failure
fail: false
- name: Attach the report
if: always()
uses: actions/upload-artifact@v1
with:
name: ${{ steps.xunit-viewer.outputs.report-name }}
path: ${{ steps.xunit-viewer.outputs.report-dir }}
test-detection:
runs-on: ubuntu-18.04
name: Run tests to ensure detection is working
steps:
- uses: actions/checkout@v1
- name: Run tests
run: test/all.sh
release:
runs-on: ubuntu-18.04
name: Release if all tests pass on master branch
needs:
- test-defaults
- test-alternate-results-path
- test-alternate-report-path
- test-detection
- test-show-failure
- test-ignore-failure
steps:
- uses: actions/checkout@v1
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}