Django CI #12
Workflow file for this run
This file contains 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: | |
workflow_dispatch | |
# push: | |
# branches: ["main"] | |
# pull_request: | |
# branches: ["main"] | |
env: | |
DEBUG: ${{ vars.DEV_DEBUG }} | |
SECRET_KEY: ${{ secrets.DEV_SECRET_KEY }} | |
ENGINE: ${{ vars.ENGINE }} | |
DB_HOST: 127.0.0.1 | |
DB_PORT: ${{ vars.POSTGRES_PORT }} | |
PG_DB: ${{ vars.DEV_DB }} | |
PG_USER: ${{ vars.POSTGRES_USER }} | |
PG_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
POSTGRES_DB: ${{ vars.POSTGRES_DB }} | |
EMAIL_BACKEND: "django.core.mail.backends.smtp.EmailBackend" | |
EMAIL_HOST: "" | |
EMAIL_PORT: "" | |
EMAIL_USE_TLS: "" | |
EMAIL_HOST_USER: "" | |
EMAIL_HOST_PASSWORD: "" | |
CORS_ORIGIN_WHITELIST: ${{ vars.CORS_ORIGIN_WHITELIST }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
services: | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_DB: ${{ vars.DEV_DB }} | |
POSTGRES_USER: ${{ vars.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout repository | |
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: | | |
pip install --upgrade pip | |
pip install -r ./requirements.txt | |
- name: Run migrations | |
run: python manage.py migrate | |
- name: Run collectstatic | |
run: python manage.py collectstatic --no-input | |
- name: Run Tests | |
run: python manage.py test | |