-
-
Notifications
You must be signed in to change notification settings - Fork 144
/
action.yml
77 lines (77 loc) · 3.34 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
name: 'Jest coverage report'
description: 'Track your code coverage in each pull request.'
author: 'Artiom Tretjakovas <[email protected]>'
branding:
icon: 'activity'
color: 'gray-dark'
inputs:
github-token:
required: true
description: 'A github access token'
default: ${{ github.token }}
test-script:
required: false
description: 'A custom npm script to get coverage'
default: npx jest
threshold:
required: false
description: 'Coverage threshold. If total coverage is less than threshold, PR will be rejected'
working-directory:
required: false
description: 'Custom working directory'
icons:
required: false
description: 'Which icons to use. Available choices: emoji, ascii'
default: emoji
annotations:
required: false
description: 'What type of annotations show. Options: none, coverage, failed-tests, all'
default: all
package-manager:
required: false
description: 'Which package manager to use; can be `npm`, `yarn`, `pnpm`, or `bun`'
default: 'npm'
skip-step:
required: false
description: '`none` for running all steps, `install` to skip installing dependencies or `all` to skip installing dependencies and running the test script'
default: 'none'
custom-title:
required: false
description: 'Sets the title of the coverage report comment in Github.'
coverage-file:
required: false
description: Path to file the a previously generated report.json file. (bypasses running the test again)
base-coverage-file:
required: false
description: Path to the report.json file to compare against. This should be from the branch the PR is merging into.
prnumber:
required: false
description: Pull Request number for this commit. Use if your action is running in a PR, but non on the pull_request event, so that you do not get multiple comments.
output:
required: false
description: What output should action produce? `comment` - add comment to PR, `report-markdown` - report markdown text in "outputs.report".
default: comment
outputs:
report:
description: Generated markdown report. Exists only if input option "output" is set to "report-markdown".
value: ${{ steps.main.outputs.report }}
runs:
using: composite
steps:
- run: $GITHUB_ACTION_PATH/run.sh
shell: bash
id: main
env:
INPUT_GITHUB-TOKEN: ${{ inputs.github-token }}
INPUT_TEST-SCRIPT: ${{ inputs.test-script }}
INPUT_THRESHOLD: ${{ inputs.threshold }}
INPUT_WORKING-DIRECTORY: ${{ inputs.working-directory }}
INPUT_ICONS: ${{ inputs.icons }}
INPUT_ANNOTATIONS: ${{ inputs.annotations }}
INPUT_PACKAGE-MANAGER: ${{ inputs.package-manager }}
INPUT_SKIP-STEP: ${{ inputs.skip-step }}
INPUT_CUSTOM-TITLE: ${{ inputs.custom-title }}
INPUT_COVERAGE-FILE: ${{ inputs.coverage-file }}
INPUT_BASE-COVERAGE-FILE: ${{ inputs.base-coverage-file }}
INPUT_PRNUMBER: ${{ inputs.prnumber }}
INPUT_OUTPUT: ${{ inputs.output }}