Skip to content

Commit

Permalink
Merge branch 'main' into cSpellChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
Skptak authored Aug 31, 2023
2 parents bd095e8 + d098bf5 commit 1a8525c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,20 @@ jobs:
test-complexity-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: FreeRTOS/coreMQTT
ref: main
path: coreMQTT

- name: Test complexity check action
uses: ./complexity
with:
path: coreMQTT
# For coreMQTT the code complexity threshold is 10.
horrid_threshold: 10

test-doxygen-zip-check:
runs-on: ubuntu-latest
steps:
Expand Down
44 changes: 37 additions & 7 deletions complexity/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,46 @@ inputs:
horrid_threshold:
description: 'The horrid threshold parameter passed to the invocation of complexity'
required: false
default: 8
default: 10

runs:
using: "composite"
steps:
- name: Setup
run: sudo apt-get install complexity
steps:

- env:
stepName: Install Dependencies
bashPass: \033[32;1mPASSED -
bashInfo: \033[33;1mINFO -
bashFail: \033[31;1mFAILED -
bashEnd: \033[0
name: ${{ env.stepName }}
shell: bash
- name: Complexity
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.stepName }}"
sudo apt-get install complexity -y
echo -e "::endgroup::"
echo -e "${{ env.bashPass }} ${{env.stepName }} ${{ env.bashEnd }}"
- env:
stepName: Complexity
bashPass: \033[32;1mPASSED -
bashInfo: \033[33;1mINFO -
bashFail: \033[31;1mFAILED -
bashEnd: \033[0m
working-directory: ${{ inputs.path }}
shell: bash
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.stepName }}"
echo -e "${{ env.bashInfo }} Have complexity limit of ${{ inputs.horrid_threshold }} ${{ env.bashEnd }}"
exitStatus=0
# Use find to find all files ending with a .c inside of the input directory
# From there run the complexity check against them
find ${{ inputs.source_path }}/ -iname '*.c' |\
xargs complexity --scores --threshold=0 --horrid-threshold=${{ inputs.horrid_threshold }}
shell: bash
xargs complexity --scores --threshold=0 --horrid-threshold=${{ inputs.horrid_threshold }}
echo -e "::endgroup::"
echo -e "${{ env.bashPass }} ${{env.stepName }} ${{ env.bashEnd }}"
exit 0

0 comments on commit 1a8525c

Please sign in to comment.