-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
63 lines (61 loc) · 1.77 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
60
61
62
63
name: 'Run tests with specified CWL runner'
author: 'Tomoya Tanjo'
description: 'Run tests with specified CWL runner'
branding:
icon: check
color: yellow
inputs:
test-list:
description: 'A file that lists test cases in cwltest format'
required: true
runner:
description: 'full path to CWL runner to be tested'
required: true
timeout:
description: 'timeout in seconds'
required: false
default: 30
skip-python-install:
description: 'skip installing python interpreter'
required: false
default: false
allow-failure:
description: 'whether this action always succeeds even if some tests fail'
required: false
default: false
result-title:
description: 'title for test result'
required: false
default: 'Test result'
outputs:
result:
description: 'The file name that stores the result of tests in JUnit XMl format'
value: ${{ steps.run-test.outputs.result }}
runs:
using: 'composite'
steps:
- name: Setup Python for testing
if: ${{ inputs.skip-python-install == 'false' }}
uses: actions/setup-python@v5
with:
python-version: '3.12.x'
- name: Install cwltest
shell: bash
run: pip install cwltest
- name: Run test
id: run-test
shell: bash
run: |
cwltest --tool ${{ inputs.runner }} --test ${{ inputs.test-list }} --timeout=${{ inputs.timeout }} --junit-xml=junit.xml; ret=$?
echo "result=junit.xml" >> $GITHUB_OUTPUT
if [ ${{ inputs.allow-failure }} != 'false' ]; then
exit $ret
else
exit 0
fi
- name: Publish the result of tests
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: junit.xml
check_name: ${{ inputs.result-title }}