Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.

tweaks

tweaks #114

Workflow file for this run

# Github actions documentation: https://docs.github.com/en/actions
# Runner images and what's in them:
# General: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# Detail: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
# Marketplace for Actions (used in "uses" clauses):
# https://github.com/marketplace?type=actions
name: Django CICD backend test
on: [push] # activates the workflow when there is a push or pull request in the repo
# Alternative syntax to specify a branch:
# on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
jobs:
build-and-test:
runs-on: ubuntu-22.04 # has postgres 14.7 installed, which is helpful to avoid having to install it ourselves
env:
DB_TEST_HOST: localhost
DB_TEST_PORT: 5432
DB_TEST_NAME: test_db
DB_TEST_USERNAME: postgres
DB_TEST_PASSWORD: postgres
DB: TEST
TEST_ENV: true
services:
postgres:
image: postgis/postgis:14-3.3 # versions available: https://registry.hub.docker.com/r/postgis/postgis/
env:
# must specify password for PG Docker container image, see: https://registry.hub.docker.com/_/postgres?tab=description&page=1&name=10
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
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:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Set up Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python -
- name: Install dependencies
run: |
poetry install --only main,test --no-root --no-interaction --no-ansi
- name: Run black (check mode)
run: |
poetry run black --check .
- name: Run ruff
run: |
ruff check .
# GDAL is a dependency for any PostGIS field.
- name: Install GDAL 3.4
run: |
sudo add-apt-repository ppa:ubuntugis/ppa -y
sudo apt-get update
sudo apt-get install --no-install-recommends -y gdal-bin=3.4.* libgdal-dev=3.4.*
- name: Run pytest
run: |
poetry run pytest
working-directory: ./be