Skip to content

feat(workflow): Added github workflows #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Python Lint

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

jobs:
python-lint:
name: Lint Python Code
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'

- name: Install linters
run: |
python -m pip install --upgrade pip
pip install flake8 black isort

- name: Run flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

- name: Check import sorting with isort
run: |
isort . --check-only
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Python Tests with Coverage

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

jobs:
test:
if: false # disables the job temporary
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.11', '3.12', '3.13']

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov

- name: Run tests with coverage
run: |
pytest --cov=your_package_name --cov-report=term --cov-report=xml --cov-fail-under=80

# Optional: Upload coverage report to Codecov (for public repos or with CODECOV_TOKEN)
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Only needed for private repos
24 changes: 24 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Trivy Security Scan

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

jobs:
trivy-scan:
runs-on: ubuntu-latest
name: Trivy FS Scan

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Run Trivy vulnerability scanner on file system
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
scanners: 'vuln,secret,config'
ignore-unfixed: true