From a4d884ac3dcac7f7b188d479a8b5a8f932335b93 Mon Sep 17 00:00:00 2001 From: Nwani Victory Date: Sun, 16 Oct 2022 11:41:13 +0100 Subject: [PATCH] feat: add propsector code analysis to CI run --- .github/workflows/analysis.yml | 27 +++++++++++++++++++++++++++ tests/requirements.txt | 1 + 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/analysis.yml diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml new file mode 100644 index 000000000..a30abe789 --- /dev/null +++ b/.github/workflows/analysis.yml @@ -0,0 +1,27 @@ +name: Static Code Analysis Of Codebase +on: [push, pull_request] + +jobs: + static_analysis: + runs-on: ubuntu-latest + steps: + - name: Checkout and set up + uses: actions/checkout@v3 + + - name: Install Python for analysis + uses: actions/setup-python@v4 + with: + python-version: 'pypy3.9' + + - name: Install dependencies for analysis + run: | + python -m pip install --upgrade pip + pip install prospector + - name: Run static code analysis using Prospector tool + run: prospector --zero-exit > static_analyis.json + + - name: Deploy Static Analysis Result to GitHub Artifacts + uses: actions/upload-artifact@v2 + with: + name: static_analysis_result + path: static_analyis.json \ No newline at end of file diff --git a/tests/requirements.txt b/tests/requirements.txt index e69de29bb..a1dc7ec7e 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -0,0 +1 @@ +prospector==1.7.7 \ No newline at end of file