Skip to content

redo actions envars testdb #4

redo actions envars testdb

redo actions envars testdb #4

name: Temp workflow to test Pytest Suite
on:
push:
branches:
- "add-cicd-auto-pytest"
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: "development"
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: List all files
run: ls -al
- name: Set up Python version
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install PostGIS dependencies
run: sudo apt-get install -y binutils libproj-dev gdal-bin libgdal-dev python3-gdal
- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate
# python dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Run Pytests
- name: Run migrations
run: python manage.py migrate
env:
E12_POSTGRES_DB_NAME: github_actions
E12_POSTGRES_DB_USER: postgres
E12_POSTGRES_DB_PASSWORD: postgres
E12_POSTGRES_DB_HOST: 127.0.0.1
E12_POSTGRES_DB_PORT: 5432
DJANGO_CSRF_TRUSTED_ORIGINS: https://localhost,https://0.0.0.0
- name: Pytest Suite
run: pytest