-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
33 lines (30 loc) · 990 Bytes
/
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
name: Code Report
author: Leukeleu B.V.
description: Reports code quality metrics
inputs:
artifact:
description: 'Name of the artifact to upload'
required: false
default: 'code-report'
type: string
filename:
description: 'Name of the file to upload'
required: false
default: 'code-report.yml'
type: string
runs:
using: composite
steps:
- name: Check whether coverage executable is available
run: which coverage &> /dev/null && echo "HAS_COVERAGE_PY=true" >> "$GITHUB_ENV" || echo "HAS_COVERAGE_PY=false" >> "$GITHUB_ENV"
shell: bash
- name: Collect coverage.py data
if: env.HAS_COVERAGE_PY == 'true'
run: |
echo "python-coverage: $(coverage report --format=total)" >> $GITHUB_WORKSPACE/${{ inputs.filename }}
shell: bash
- name: Upload code report
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact }}
path: ${{ github.workspace }}/${{ inputs.filename }}