Skip to content

Add Radon analysis workflow for cyclomatic complexity checks #4

Add Radon analysis workflow for cyclomatic complexity checks

Add Radon analysis workflow for cyclomatic complexity checks #4

name: Radon Cyclomatic Complexity
on:
push:
branches:
- main
pull_request:
jobs:
radon-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install radon
- name: Run Radon Cyclomatic Complexity
run: |
radon cc -s -a src/masoniteorm/collection > radon_output.txt
- name: Read Radon Output
id: radon
run: |
output=$(cat radon_output.txt)
echo "::set-output name=radon_output::$output"
- name: Comment on Pull Request
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: Radon Cyclomatic Complexity Report
message: |
```console
${{ steps.radon.outputs.radon_output }}
```