Skip to content

Commit

Permalink
CI Workflow Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiran Jojare committed Jul 19, 2024
1 parent 7b27dcf commit 956b61d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,27 @@ name: CI

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12.2
python-version: '3.12.2'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
pip install coverage
coverage run -m unittest discover test
coverage report
coverage xml
run: make install

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true

- name: Codacy code quality
uses: codacy/codacy-analysis-cli-action@v4
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
- name: Lint and Check Code
run: make all
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: lint check

# Install dependencies
install:
pip install -r requirements.txt

# Lint the code using flake8
lint:
flake8 src test --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src test --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

# Check if all Python files are error-free using mypy
check:
mypy src test

# Run all checks
all: install lint check

0 comments on commit 956b61d

Please sign in to comment.