Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
exe-path: executable-monitor/test.out
success-line: "SLEEPING FOR 6 SECONDS"
timeout-seconds: 20

- name: Functional Test | Success Case | No Retries, No Success Line, Exit Code
id: test-executable-monitor-action-no-retry-attempts-exit-code
uses: ./executable-monitor
Expand All @@ -125,7 +125,7 @@ jobs:
exe-path: executable-monitor/test.out
success-line: "SLEEPING FOR 6 SECONDS"
retry-attempts: 2

- name: API Test | Success Case | Retries, No Success Line, Exit Code, Use Default Timeout
id: test-executable-monitor-action-no-success-line-no-timeout
uses: ./executable-monitor
Expand Down Expand Up @@ -222,18 +222,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 Expand Up @@ -353,7 +355,7 @@ jobs:
repository: FreeRTOS/FreeRTOS
ref: '202107.00'
path: FreeRTOS
submodules: recursive
submodules: recursive
- name: Test manifest verifier
uses: ./manifest-verifier
with:
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