Skip to content

Instantly share code, notes, and snippets.

@sabderemane
Last active April 28, 2024 19:29
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sabderemane/bae142f8dab61c6aa6ce57f38eaa269e to your computer and use it in GitHub Desktop.
Save sabderemane/bae142f8dab61c6aa6ce57f38eaa269e to your computer and use it in GitHub Desktop.
Full workflow of python with docker services (postgres), to run django tests
name: Test Workflow
on: push
jobs:
test:
runs-on: ubuntu-latest
services:
image: postgres
env:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- POSTGRES_BD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8.9
- uses: actions/setup-python@v2
with:
python-version: 3.8.9
- name: Install dependencies
run: pip install -r requirements.txt
- 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