generated from MasoniteFramework/starter-package
-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Radon analysis workflow to support both push and pull_reques…
…t events and ensure full git history is available
- Loading branch information
1 parent
86daadf
commit f62592e
Showing
1 changed file
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
name: Radon Analysis | ||
on: | ||
pull_request: | ||
branches: ["2.0"] | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
comment: | ||
permissions: | ||
pull-requests: write | ||
radon-analysis: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Radon | ||
run: pip install radon | ||
- name: Create Radon's reports | ||
run: | | ||
radon cc $(git diff --name-only 2.0...HEAD || echo "no_files") -j >cc.json | ||
radon mi $(git diff --name-only 2.0...HEAD || echo "no_files") -j >mi.json | ||
radon hal $(git diff --name-only 2.0...HEAD || echo "no_files") -j >hal.json | ||
- name: Comment the results on the PR | ||
uses: Libra-foundation/[email protected] | ||
with: | ||
cc: "cc.json" | ||
mi: "mi.json" | ||
hal: "hal.json" | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install Radon | ||
run: pip install radon | ||
|
||
- name: Run Radon Analysis | ||
run: | | ||
git fetch --unshallow # Ensure full history is available | ||
radon cc $(git diff --name-only 2.0...HEAD || echo "no_files") -j >cc.json |