Skip to content

Commit

Permalink
Add GitHub Actions CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pdr21001 authored Apr 18, 2025
1 parent d9baa1c commit 04ffc3f
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Backend CI Pipeline

# Trigger workflow on push or pull request to develop and main branches
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main

jobs:
lint:
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11' # Adjust Python version if needed

- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Run pylint on Python code
run: |
source venv/bin/activate
pylint backend/main.py backend/db.py backend/init_db.py # Add more files as needed
test:
runs-on: ubuntu-latest
needs: lint # Ensure this job runs after linting

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

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

- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Run tests with pytest
run: |
source venv/bin/activate
pytest backend/tests --maxfail=1 --disable-warnings -q

0 comments on commit 04ffc3f

Please sign in to comment.