From a1ec2c6b828b9ef2a0c18171fd5bebbb02e3ef66 Mon Sep 17 00:00:00 2001 From: BIPLAV00 Date: Wed, 6 Nov 2024 11:11:16 +0545 Subject: [PATCH 1/2] ci: add MR workflow for code formatting, linting, and static analysis --- .github/workflows/ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3c5853a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: MR Workflow + +on: + pull_request: + branches: + - main + +jobs: + format-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Install Black + run: pip install black + + - name: Run Black (Code Format Check) + run: black . + + lint-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Install Flake8 + run: pip install flake8 + + - name: Run Flake8 (Lint Check) + run: flake8 . + + static-analysis: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install Bandit + run: pip install bandit + + - name: Run Bandit (Static Analysis) + run: bandit -r . From 920075dc99cdda61d0bee221b5d6717238eda8b2 Mon Sep 17 00:00:00 2001 From: BIPLAV00 Date: Wed, 6 Nov 2024 11:28:09 +0545 Subject: [PATCH 2/2] refac: remove python version to use latest one --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c5853a..d698f0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,8 +44,6 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 - with: - python-version: '3.x' - name: Install Bandit run: pip install bandit