-
-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathaction.yml
59 lines (55 loc) · 1.75 KB
/
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
name: 'Test report'
description: 'Create test report'
inputs:
name:
description: 'name'
required: false
default: 'test-results'
electron:
description: 'Electron version'
required: true
os:
description: 'runs-on'
required: true
runs:
using: "composite"
steps:
- name: "Merge test files"
shell: bash
run: node tools/mergeTests.js ${{ inputs.electron }}
- name: Read mochawesome.json
uses: actions/github-script@v7
with:
result-encoding: string
script: |
try {
const fs = require('fs')
const jsonString = fs.readFileSync('test/mochawesome-report/mochawesome.json')
var report = JSON.parse(jsonString);
let stats = {
passing: report.stats.passes,
skipped: report.stats.pending,
failures: report.stats.failures
};
core.notice(JSON.stringify(stats));
} catch(err) {
core.error("Error while reading or parsing test/mochawesome-report/mochawesome.json")
core.setFailed(err)
}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: ${{ inputs.name }}-${{ inputs.os }}-${{ inputs.electron }}
path: |
test/mochawesome-report/mochawesome.json
test/mochawesome-report/mochawesome.html
test/mochawesome-report/assets/
- name: Create test report
uses: phoenix-actions/test-reporting@v15
if: success()
with:
name: ${{ inputs.name }}-${{ inputs.os }}-v${{ inputs.electron }}
fail-on-error: true
path: test/mochawesome-report/mochawesome.json # Path to test results
reporter: mochawesome-json