Skip to content

Add Radon analysis workflow for cyclomatic complexity checks #8

Add Radon analysis workflow for cyclomatic complexity checks

Add Radon analysis workflow for cyclomatic complexity checks #8

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
id: radon
run: |
radon cc -s -a src/masoniteorm/collection > radon_output.txt
output=$(cat radon_output.txt)
echo "$output"
echo "radon_output=$output" >> $GITHUB_ENV
- 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
${{ env.radon_output }}
```