Skip to content

Commit af80dd2

Browse files
committed
Refactor Radon analysis workflow to trigger on pull requests and streamline report generation
1 parent 1f82378 commit af80dd2

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

.github/workflows/radon-analysis.yml

+19-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
name: Radon Analysis
2-
3-
on: [push, pull_request]
1+
name: Radon
2+
on:
3+
pull_request:
4+
branches: ["main"]
45

56
jobs:
6-
radon-analysis:
7+
comment:
8+
permissions:
9+
pull-requests: write
710
runs-on: ubuntu-latest
8-
911
steps:
10-
- name: Checkout repository
11-
uses: actions/checkout@v2
12-
with:
13-
fetch-depth: 0 # Fetch all history for all branches and tags
14-
15-
- name: Set up Python
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: '3.x'
19-
20-
- name: Install Radon
21-
run: pip install radon
22-
23-
- name: Run Radon Analysis
24-
run: |
25-
git fetch # Ensure full history is available
26-
radon cc $(git diff --name-only master...HEAD || echo "no_files") -j >cc.json
12+
- uses: actions/checkout@v3
13+
- name: Create Radon's reports
14+
run: |
15+
radon cc src/ -j >cc.json
16+
radon mi src/ -j >mi.json
17+
radon hal src/ -j >hal.json
18+
- name: Comment the results on the PR
19+
uses: Libra-foundation/[email protected]
20+
with:
21+
cc: "cc.json"
22+
mi: "mi.json"
23+
hal: "hal.json"

0 commit comments

Comments
 (0)