46 lines
No EOL
1.1 KiB
YAML
46 lines
No EOL
1.1 KiB
YAML
name: CI/CD Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Lint with flake8
|
|
run: |
|
|
pip install flake8
|
|
flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
|
|
- name: Run tests with pytest
|
|
run: |
|
|
pip install pytest pytest-cov
|
|
pytest --cov=app --cov-report=xml
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
fail_ci_if_error: false
|
|
|
|
- name: Notify via Slack (optional)
|
|
if: always()
|
|
run: |
|
|
echo "CI/CD Pipeline completed"
|
|
# Add Slack/Discord webhook notification here if needed |