Skip to content

Release 1.0.0

Release 1.0.0 #53

Workflow file for this run

name: Run unit test
on:
workflow_dispatch:
pull_request:
types: [opened, edited, synchronize]
jobs:
pytest:
runs-on: ubuntu-latest
# Run the job in this container
container: python:3.10-bullseye
env:
POSTGRES_SERVER: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_TEST_DB: tests_challenger_expedition
# Service containers to run with `pytest` job
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgis/postgis:14-master
# Provide the password for postgres
env:
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install PostgreSQL client
run: |
apt-get update
apt-get install -y postgresql-client
- name: Install python requirements
run: |
pip install -U pip
pip install poetry
poetry install
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run Unit Testing
run: bash ./scripts/run_tests.sh
env:
# The following are needed for dropdb and createdb commands in run_tests.sh
PGHOST: ${{ env.POSTGRES_SERVER }}
PGPORT: ${{ env.POSTGRES_PORT }}
PGUSER: ${{ env.POSTGRES_USER }}
PGPASSWORD: ${{ env.POSTGRES_PASSWORD }}
# Environment variables required by FastAPI
SERVER_HOST: http://localhost
SENTRY_DSN: ""
POSTGRES_DB: challenger_expedition
FIRST_SUPERUSER: [email protected]
FIRST_SUPERUSER_PASSWORD: secret_password
SECRET_KEY: pytest_secret_key