Add: PANCAKE White Paper - DPI for Agriculture in the AI Era #39
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: Pancake CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| lint-and-type-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 app tests --max-line-length=120 --exclude=venv,migrations | |
| - name: Type check with mypy | |
| run: | | |
| mypy app --ignore-missing-imports | |
| continue-on-error: true | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:14-alpine | |
| env: | |
| POSTGRES_USER: pancake_user | |
| POSTGRES_PASSWORD: pancake_pass | |
| POSTGRES_DB: pancake_test_db | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run unit tests | |
| env: | |
| DATABASE_URL: postgresql://pancake_user:pancake_pass@localhost:5432/pancake_test_db | |
| run: | | |
| pytest tests/unit -v --cov=app --cov-report=xml | |
| - name: Run functional tests | |
| env: | |
| DATABASE_URL: postgresql://pancake_user:pancake_pass@localhost:5432/pancake_test_db | |
| run: | | |
| pytest tests/functional -v | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build Docker image | |
| run: | | |
| docker build -t pancake:test . | |
| - name: Scan with Trivy | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: pancake:test | |
| format: 'sarif' | |
| output: 'trivy-results.sarif' | |
| - name: Upload Trivy results | |
| uses: github/codeql-action/upload-sarif@v2 | |
| with: | |
| sarif_file: 'trivy-results.sarif' | |