Advertisement
Guest User

failng-pg-jobs

a guest
Dec 29th, 2021
146
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. name: Tests
  2. on: push
  3. jobs:
  4.   test:
  5.     runs-on: ubuntu-latest
  6.     services:
  7.      # Label used to access the service container
  8.       db:
  9.        # Docker Hub image
  10.         image: postgres:latest
  11.         # Provide the password for postgres
  12.         env:
  13.           POSTGRES_PASSWORD: redacted
  14.         # Set health checks to wait until postgres has started
  15.         options: >-
  16.           --health-cmd pg_isready
  17.           --health-interval 10s
  18.           --health-timeout 5s
  19.           --health-retries 5
  20.  
  21.     steps:
  22.       - uses: actions/checkout@v2
  23.       - name: Make env file for tests
  24.         uses: SpicyPizza/create-envfile@v1
  25.         with:
  26.           envkey_DJANGO_SECRET_KEY: redacted
  27.           envkey_DEBUG: True
  28.           envkey_DJANGO_ALLOWED_HOSTS: 127.0.0.1
  29.           envkey_DATABASE_ENGINE: postgresql
  30.           envkey_DATABASE_NAME: test_db
  31.           envkey_DATABASE_USERNAME: postgres
  32.           envkey_DATABASE_PASSWORD: redacted
  33.           envkey_DATABASE_HOST: db
  34.           envkey_DATABASE_PORT: 5432
  35.           file_name: env
  36.       - name: Build the stack
  37.         run: docker-compose build
  38.       - name: Run the tests
  39.         run: docker-compose run web python manage.py test -v 2
  40.  
Advertisement
RAW Paste Data Copied
Advertisement