Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Add complexity workflow file #1722

Closed
wants to merge 5 commits into from
Closed
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
55 changes: 55 additions & 0 deletions .github/workflows/check-complexity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Wily on PR

on:
pull_request:


jobs:

evaluate-complexity:
name: Evaluate Code complexity
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Install Wily
run: pip install wily==1.20.0
- name: Build cache and diff
id: wily
run: |
wily build my_package/ tests/
DIFF=$(wily diff my_package/ tests/ --no-detail -r origin/${{ github.event.pull_request.base.ref }})
echo "$DIFF"

# Build multine output
DIFF="${DIFF//'%'/'%25'}"
DIFF="${DIFF//$'\n'/'%0A'}"
DIFF="${DIFF//$'\r'/'%0D'}"
echo "::set-output name=diff::$DIFF"
- name: Find current PR
uses: jwalton/gh-find-current-pr@v1
id: findPr
- name: Add Wily PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: steps.findPr.outputs.number && steps.wily.outputs.diff != ''
with:
recreate: true
number: ${{ steps.findPr.outputs.number }}
message: |
```
${{ steps.wily.outputs.diff }}
```
- name: Add Wily PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: steps.findPr.outputs.number && steps.wily.outputs.diff == ''
with:
recreate: true
number: ${{ steps.findPr.outputs.number }}
message: |
```
Wily: No changes in complexity detected.
```
Loading