diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index dd5fa996..2c85abf1 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -2,15 +2,29 @@ name: Django CI on: push: - branches: [ "develop" ] + branches: [ "testing" ] pull_request: - branches: [ "develop" ] + branches: [ "testing" ] jobs: build: runs-on: ubuntu-latest + services: + postgres: + image: postgres:16 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: github_actions + + ports: + - 5433:5432 + + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 @@ -22,5 +36,14 @@ jobs: python3 -m pip install --upgrade pip pip install -r requirements.txt - name: Run Tests + env: + SECRET_KEY: ${{ secrets.SECRET_KEY }} + DB_NAME: ${{ secrets.DB_NAME }} + DB_USER: ${{ secrets.DB_USER }} + DB_PASSWORD: ${{ secrets.DB_PASSWORD }} + DB_HOST: ${{ secrets.DB_HOST }} + DB_PORT: ${{ secrets.DB_PORT }} + DB_ENGINE: ${{secrets.DB_ENGINE}} + run: | python manage.py test