try json output for future report tracking (#2072)

* try json output for future report tracking

* change bash env for shellcheck

* changes shellcheck step name
This commit is contained in:
lanefu
2020-06-29 23:18:17 -04:00
committed by GitHub
parent f6abcc7c85
commit 22b5615594

View File

@@ -12,9 +12,13 @@ jobs:
- name: Environment variables
run: sudo -E bash -c set
- name: Install required packages
run: sudo apt-get install shellcheck
- name: "lint libraries via shellcheck"
run: shellcheck --color -x -s bash -S warning -e SC2034,SC1090,SC2154,SC2153 lib/*.sh && echo "shellcheck lib/*.sh - OK";
run: sudo apt-get install shellcheck jq
- name: "shellcheck lint error report json format"
shell: bash {0}
run: |
shellcheck -f json -x -s bash -S warning -e SC2034,SC1090,SC2154,SC2153 lib/*.sh > report.json
cat report.json |jq -C 'group_by(.file)|.[] | {file: [(limit(1;.[].file)), {shellcheck_codes: [{code: (group_by(.code)|.[] | limit(1;.[].code)), count: length}]}], file_error_count: length}'
#shellcheck --color -x -s bash -S warning -e SC2034,SC1090,SC2154,SC2153 lib/*.sh && echo "shellcheck lib/*.sh - OK";
build_sbc_kernel:
name: Compile changed kernel
# This job runs on self hosted Linux machine, with public label