From 4784586883add8980a9ada9ff6c28c242b1db9e6 Mon Sep 17 00:00:00 2001 From: rahul-tuli Date: Thu, 14 Sep 2023 11:01:16 -0400 Subject: [PATCH 1/5] Add complexity workflow file --- .github/check-complexity.yaml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/check-complexity.yaml diff --git a/.github/check-complexity.yaml b/.github/check-complexity.yaml new file mode 100644 index 00000000000..7b381803b7f --- /dev/null +++ b/.github/check-complexity.yaml @@ -0,0 +1,59 @@ +name: 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.8.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. + ``` \ No newline at end of file From 145bd5c2997b76bebcb4275ef87b384b61f44339 Mon Sep 17 00:00:00 2001 From: rahul-tuli Date: Thu, 14 Sep 2023 11:04:29 -0400 Subject: [PATCH 2/5] Move file --- .github/workflows/check-complexity.yaml | 59 +++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/check-complexity.yaml diff --git a/.github/workflows/check-complexity.yaml b/.github/workflows/check-complexity.yaml new file mode 100644 index 00000000000..7b381803b7f --- /dev/null +++ b/.github/workflows/check-complexity.yaml @@ -0,0 +1,59 @@ +name: 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.8.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. + ``` \ No newline at end of file From dd741e0e7503a6c187974c60b49a05479961410c Mon Sep 17 00:00:00 2001 From: rahul-tuli Date: Thu, 14 Sep 2023 11:05:03 -0400 Subject: [PATCH 3/5] Delete OG file --- .github/check-complexity.yaml | 59 ----------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 .github/check-complexity.yaml diff --git a/.github/check-complexity.yaml b/.github/check-complexity.yaml deleted file mode 100644 index 7b381803b7f..00000000000 --- a/.github/check-complexity.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: 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.8.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. - ``` \ No newline at end of file From f6f371f3378e5b97301b830889ed07e886a53d26 Mon Sep 17 00:00:00 2001 From: rahul-tuli Date: Thu, 14 Sep 2023 11:08:43 -0400 Subject: [PATCH 4/5] Update to python 3.10 --- .github/workflows/check-complexity.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-complexity.yaml b/.github/workflows/check-complexity.yaml index 7b381803b7f..13c27837d11 100644 --- a/.github/workflows/check-complexity.yaml +++ b/.github/workflows/check-complexity.yaml @@ -1,4 +1,4 @@ -name: Wily Pipeline on PR +name: Wily on PR on: pull_request: @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8.0 + python-version: 3.10.0 - name: Install Wily run: pip install wily==1.20.0 - name: Build cache and diff From 07b202d623c20557e1f7aaae357f37e6a14bdc10 Mon Sep 17 00:00:00 2001 From: rahul-tuli Date: Thu, 14 Sep 2023 12:32:30 -0400 Subject: [PATCH 5/5] Remove python setup --- .github/workflows/check-complexity.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/check-complexity.yaml b/.github/workflows/check-complexity.yaml index 13c27837d11..0bd8c04d96c 100644 --- a/.github/workflows/check-complexity.yaml +++ b/.github/workflows/check-complexity.yaml @@ -8,7 +8,7 @@ jobs: evaluate-complexity: name: Evaluate Code complexity - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout repository @@ -16,10 +16,6 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }} - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.10.0 - name: Install Wily run: pip install wily==1.20.0 - name: Build cache and diff