merge feat -> main #19
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: Django CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11"] | |
| env: | |
| DJANGO_SETTINGS_MODULE: main.settings | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Verify Files | |
| run: test -f requirements.txt && test -f main/settings.py || { echo "Files missing"; exit 1; } | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} | |
| restore-keys: ${{ runner.os }}-pip-${{ matrix.python-version }}- | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install django -r requirements.txt || { echo "Dependency installation failed"; exit 1; } | |
| - name: Run Migrations | |
| run: python manage.py migrate || { echo "Database migration failed"; exit 1; } | |
| - name: Collect Static Files | |
| run: python manage.py collectstatic --noinput |