-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
78 lines (75 loc) · 2.66 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
name: 'Array API tests reporting'
description: 'Run the array API testsuite and report the results'
inputs:
array-api-tests-module:
description: 'Name of the namespace to run the array API testsuite against'
required: true
type: string
array-library-name:
description: "Name of the array library being tested. Defaults to inputs.array-api-tests-module"
required: false
type: string
array-library-version:
description: "Version of the array library being tested"
required: true
type: string
array-library-install:
description: "Command to install the array library"
required: true
type: string
python-version:
description: "Version of Python to run the testsuite on"
required: false
type: string
default: "3.10"
outputs:
results:
description: "The results JSON"
value: ${{ steps.load-results.outputs.results }}
post_data=:
description: "The data to be posted to the webhook"
value: ${{ steps.load-results.outputs.post_data }}
runs:
using: "composite"
steps:
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- name: Checkout array-api-tests
uses: actions/checkout@v3
with:
repository: data-apis/array-api-tests
ref: "master"
submodules: 'true'
path: array-api-tests
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: "Install the array API tests test suite"
run: install.sh
shell: bash
- name: "Install the array library"
run: ${{ inputs.array-library-install }}
shell: bash
- name: "Run the array API test suite"
run: test.sh ${{ inputs.array-api-tests-module }}
shell: bash
- name: "Upload JSON report artifact"
uses: actions/upload-artifact@main
with:
name: json-report
path: "${{ format('{0}/array-api-tests/.report.json', env.GITHUB_WORKSPACE) }}"
- name: 'Load results'
id: load-results
run: |
cd $GITHUB_WORKSPACE/array-api-tests
results=`cat ./.report.json`
echo "::set-output name=results::$results"
platform=`jq .environment.Platform $results`
python_version=`jq .environment.Python $results`
post_data='{ "schema": "v1", "name": "${{ inputs.array-api-tests-module }}", "version": ${{ inputs.array-library-version }}, "timestamp": ${{ github.event.release.created_at }}, "platform": "$platform", "python": $python_version, "data": ${{ steps.load-results.outputs.results }}, "test_suite": "..." }'
echo "::set-output name=post_data::$post_data"
shell: bash
branding:
icon: 'grid'
color: 'blue'