-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
113 lines (106 loc) · 3.58 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
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
name: 'Run CWL conformance tests'
author: 'Tomoya Tanjo'
description: 'Run CWL conformance tests'
branding:
icon: check-square
color: yellow
inputs:
cwlVersion:
description: 'CWL version'
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
tags:
description: 'tags to be tested (e.g., "docker,required")'
required: false
n:
description: 'specify tests by their numbers (e.g., "1-5,10,13")'
required: false
s:
description: 'specify tests by their names (e.g., "test_a,test_b")'
required: false
extra:
description: 'extra arguments for the given CWL runner'
required: false
# TODO: -j
outputs:
badgedir:
description: 'The directory name that stores conformance badges'
value: ${{ steps.conformance-test.outputs.badgedir }}
result:
description: 'The file name that stores the result of conformance tests in JUnit XMl format'
value: ${{ steps.conformance-test.outputs.result }}
runs:
using: 'composite'
steps:
- id: get-cwl-repository
shell: bash
run: |
baseOwner='common-workflow-language'
if [ ${cwlVersion} = 'v1.0' ]; then
repo='common-workflow-language'
elif [ ${cwlVersion} = 'v1.1' ]; then
repo='cwl-v1.1'
elif [ ${cwlVersion} = 'v1.2' ]; then
repo='cwl-v1.2'
else
echo "::error ::Unsupported cwlVersion: '${cwlVersion}'"
exit 1
fi
echo "repo=${baseOwner}/${repo}" >> $GITHUB_OUTPUT
env:
cwlVersion: ${{ inputs.cwlVersion }}
- uses: actions/checkout@v4
with:
repository: ${{ steps.get-cwl-repository.outputs.repo }}
ref: main
path: cwl-run-conformance-${{ inputs.cwlVersion }}
- 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 conformance test
id: conformance-test
working-directory: ${{ github.workspace }}/cwl-run-conformance-${{ inputs.cwlVersion }}
shell: bash
run: |
if [ ${{ inputs.cwlVersion }} = 'v1.0' ]; then
basedir=..
else
basedir=.
fi
if [ -n "${{ inputs.tags }}" ]; then
tagopt="--tags=${{ inputs.tags }}"
fi
if [ -n "${{ inputs.n }}" ]; then
nopt="-n=${{ inputs.n }}"
fi
if [ -n "${{ inputs.s }}" ]; then
sopt="-s=${{ inputs.s }}"
fi
if [ -n "${{ inputs.extra }}" ]; then
extraopt="EXTRA=${{ inputs.extra }}"
fi
./run_test.sh RUNNER=${{inputs.runner}} --badgedir=$basedir/badges --junit-xml=$basedir/junit.xml --timeout=${{inputs.timeout}} $tagopt $nopt $sopt "$extraopt" || true
echo "badgedir=$GITHUB_WORKSPACE/cwl-run-conformance-${{ inputs.cwlVersion }}/badges" >> $GITHUB_OUTPUT
echo "result=$GITHUB_WORKSPACE/cwl-run-conformance-${{ inputs.cwlVersion }}/junit.xml" >> $GITHUB_OUTPUT
env:
cwlVersion:
- name: Publish the result of conformance tests
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: ${{ github.workspace }}/cwl-run-conformance-${{ inputs.cwlVersion }}/junit.xml
check_name: The result of conformance tests for CWL ${{ inputs.cwlVersion }}