-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaction.yml
54 lines (51 loc) · 1.9 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
name: 'coherent-swift'
description: 'Measures cohesion in your Swift codebase'
author: 'Arthur Alves <[email protected]>'
branding:
icon: "code"
color: "green"
inputs:
sources:
description: 'Source folders to scan.'
required: true
minimum_threshold:
description: 'Overall cohesion will be validated against this minimum threshold.'
required: true
default: '80'
reports_folder:
description: 'The folder where your reports will be saved to.'
required: true
default: './coherent-swift-reports'
ignore_output_result:
description: 'If "true", measure in passive mode. Observe without enforcing changes'
required: true
default: 'false'
report_format:
description: 'Format of cohesion report. Available formats: json, plain'
required: true
default: 'json'
only_changes:
description: 'If "true", only measure cohesion on changed files.'
required: true
default: 'false'
runs:
using: "composite"
steps:
- name: Prepare spec
shell: bash
run: |
echo -e "sources:\n - ${{ inputs.sources }}\n" > ${{ github.action_path }}/_coherent-swift.yml
echo -e "minimum_threshold: ${{ inputs.minimum_threshold }}\n" >> ${{ github.action_path }}/_coherent-swift.yml
echo -e "reports_folder: ${{ inputs.reports_folder }}\n" >> ${{ github.action_path }}/_coherent-swift.yml
echo -e "ignore_output_result: ${{ inputs.ignore_output_result }}\n" >> ${{ github.action_path }}/_coherent-swift.yml
echo -e "report_format: ${{ inputs.report_format }}\n" >> ${{ github.action_path }}/_coherent-swift.yml
- name: Measure cohesion
shell: bash
run: |
cd ${{ github.action_path }}
make githubci-install
if [[ ${{ inputs.only_changes }} == 'true' ]]; then
coherent-swift report -d -s _coherent-swift.yml
else
coherent-swift report -s _coherent-swift.yml
fi