Re Structuring and bugs fixed to the program #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |