Merge pull request #8 from codersforcauses/issue-3-Create_Timetable_Page #5
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: Backend code checks | |
| on: | |
| push: | |
| branches: [use_uv] | |
| pull_request: | |
| types: ["opened", "synchronize", "reopened", "edited"] | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| name: Run Flake8 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: "Install flake8 and plugins" | |
| run: | | |
| pip install flake8 flake8-django | |
| - name: "Run flake8" | |
| uses: liskin/gh-problem-matcher-wrap@v1 | |
| with: | |
| linters: flake8 | |
| run: flake8 --max-line-length 150 server/ | |
| build: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: server | |
| services: | |
| db: | |
| image: postgres | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: github-actions | |
| ports: | |
| - 5432:5432 | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| run: pip install uv | |
| - name: Install dependencies 👨🏻💻 | |
| run: uv sync --frozen | |
| - name: Run Migrations 🕊️ | |
| env: | |
| API_SECRET_KEY: o!v%_v0zjvc5+_)e!r+o!_uefr2a&)lfgv17$ex=a!ei%!y-_o | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_PORT: 5432 | |
| EMAIL_PORT: 1025 | |
| FRONTEND_URL: http://localhost:3000 | |
| run: uv run python manage.py migrate | |
| - name: Run tests 🧪 | |
| env: | |
| API_SECRET_KEY: o!v%_v0zjvc5+_)e!r+o!_uefr2a&)lfgv17$ex=a!ei%!y-_o | |
| JWT_SIGNING_KEY: NjMgNmYgNmQgNmQgNzUgNmUgNjkgNzQgNzkgNzMgNzAgNjkgNzIgNjkgNzQgNjYgNmYgNzUgNmUgNjQgNjEgNzQgNjkgNmYgNmU= | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_PORT: 5432 | |
| EMAIL_PORT: 1025 | |
| FRONTEND_URL: http://localhost:3000 | |
| run: | | |
| uv run coverage run manage.py test | |
| uv run coverage xml | |
| - name: Upload Coverage ☂️ | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| flags: backend | |
| files: ./server/coverage.xml |