Skip to content

Instantly share code, notes, and snippets.

@mitchtabian
Created February 11, 2023 17:11
Show Gist options
  • Select an option

  • Save mitchtabian/c59e7aab07e33c96f8724ec1219b2258 to your computer and use it in GitHub Desktop.

Select an option

Save mitchtabian/c59e7aab07e33c96f8724ec1219b2258 to your computer and use it in GitHub Desktop.

Revisions

  1. mitchtabian created this gist Feb 11, 2023.
    55 changes: 55 additions & 0 deletions project_unit_tests.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    name: Django CI

    on:
    push:
    branches: [ master ]
    pull_request:
    branches: [ master ]

    jobs:
    build:

    runs-on: ubuntu-latest

    services:
    postgres:
    image: postgres:latest
    env:
    POSTGRES_USER: postgres
    POSTGRES_PASSWORD: postgres
    POSTGRES_DB: github_actions
    ports:
    - 5432:5432
    options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

    strategy:
    max-parallel: 4
    matrix:
    python-version: [3.9]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
    uses: actions/setup-python@v1
    with:
    python-version: ${{ matrix.python-version }}
    - name: Install Dependencies
    run: |
    python -m pip install --upgrade pip
    pip install -r requirements.txt
    - name: Run Tests'
    env:
    SECRET_KEY: 69tgugtg%^fgJO&*&
    DB_NAME: github_actions
    DB_USER: postgres
    DB_PASSWORD: postgres
    DJANGO_ALLOWED_HOSTS: localhost 127.0.0.1 [::1]
    DEBUG_MODE: False
    TIME_ZONE: US/Pacific
    CACHE_KEY_PREFIX: Halo
    GOOGLE_AUTH_CLIENT_ID: whocares
    GOOGLE_AUTH_CLIENT_SECRET: whocares2
    EMAIL_ID: dunno
    EMAIL_PASSWORD: dunno2
    run: |
    python manage.py test