Skip to content

Re Structuring and bugs fixed to the program #1

Re Structuring and bugs fixed to the program

Re Structuring and bugs fixed to the program #1

Workflow file for this run

name: πŸš€ Low Light Enhancer CI/CD
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
steps:
- uses: actions/checkout@v3
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
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 flake8
- name: πŸ” Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: πŸ§ͺ Test with pytest
run: |
pytest tests/ --cov=src --cov-report=xml
- name: πŸ“Š Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: πŸ”’ Run security checks
uses: securecodewarrior/github-action-add-sarif@v1
with:
sarif-file: 'security-report.sarif'
build-and-deploy:
needs: [test]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: 🐳 Build Docker image
run: |
docker build -t low-light-enhancer:latest .
- name: πŸš€ Deploy to Streamlit Cloud
run: |
echo "Deployment triggered automatically via Streamlit Cloud"