Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name: Tests
- on: push
- jobs:
- test:
- runs-on: ubuntu-latest
- services:
- # Label used to access the service container
- db:
- # Docker Hub image
- image: postgres:latest
- # Provide the password for postgres
- env:
- POSTGRES_PASSWORD: redacted
- # Set health checks to wait until postgres has started
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- steps:
- - uses: actions/checkout@v2
- - name: Make env file for tests
- uses: SpicyPizza/create-envfile@v1
- with:
- envkey_DJANGO_SECRET_KEY: redacted
- envkey_DEBUG: True
- envkey_DJANGO_ALLOWED_HOSTS: 127.0.0.1
- envkey_DATABASE_ENGINE: postgresql
- envkey_DATABASE_NAME: test_db
- envkey_DATABASE_USERNAME: postgres
- envkey_DATABASE_PASSWORD: redacted
- envkey_DATABASE_HOST: db
- envkey_DATABASE_PORT: 5432
- file_name: env
- - name: Build the stack
- run: docker-compose build
- - name: Run the tests
- run: docker-compose run web python manage.py test -v 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement