-
-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (53 loc) · 1.7 KB
/
test_wily.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Example Wily Pipeline on PR
on:
pull_request:
jobs:
evaluate-complexity:
name: Evaluate Code complexity
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.13.0
- 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.
```