Skip to content

Instantly share code, notes, and snippets.

@wsvincent
Created October 27, 2023 23:42
Show Gist options
  • Save wsvincent/ae9a4eeb4bfe6fe3551e4081645da301 to your computer and use it in GitHub Desktop.
Save wsvincent/ae9a4eeb4bfe6fe3551e4081645da301 to your computer and use it in GitHub Desktop.
GitHub Actions CI
name: Continuous Integration
on:
- push
- pull_request
jobs:
test:
name: Run Python/Django Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports: [ '5432:5432' ]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
ALLOWED_HOSTS: '*'
SECRET_KEY: 'a secret to everybody'
SENDGRID_API_KEY: 'fake_apikey'
steps:
- name: Get the code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'requirements*.txt'
- name: Install packages
run: pip install -r requirements.txt
- name: Collect Static Assets
run: python manage.py collectstatic --noinput
- name: Run tests
run: python manage.py test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment