-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from arthurpalves/action
Action
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: test_action | ||
|
||
on: | ||
push: | ||
branches: [ action ] | ||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: arthurpalves/[email protected] | ||
with: | ||
source: Sources/ | ||
minimum_threshold: 60 | ||
ignore_output_result: true | ||
only_changes: true | ||
report_format: plain | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: 'coherent-swift' | ||
description: 'Measures cohesion in your Swift codebase' | ||
author: 'Arthur Alves <[email protected]>' | ||
branding: | ||
icon: "code" | ||
color: "green" | ||
|
||
inputs: | ||
source: | ||
description: 'Source folder 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 "source: ${{ inputs.source }}\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 }} | ||
if [[ ${{ inputs.only_changes }} == 'true' ]]; then | ||
swift run coherent-swift report -d -s _coherent-swift.yml | ||
else | ||
swift run coherent-swift report -s _coherent-swift.yml | ||
fi |