Creates new Layer for project areas, filtered by scenario #3587
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Django CI | |
on: | |
push: | |
branches: ["cleanup"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: psf/black@stable | |
with: | |
options: "--check" | |
src: "src/planscape" | |
version: "23.7.0" | |
build: | |
runs-on: ubuntu-latest | |
needs: lint | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.10.8] | |
services: | |
postgres: | |
image: postgis/postgis:14-3.3 | |
env: | |
# must specify password for PG Docker container image | |
# see: https://registry.hub.docker.com/_/postgres?tab=description&page=1&name=10 | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: planscape | |
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: Update Apt Cache | |
run: sudo apt-get update | |
- name: Install Apt Dependencies | |
run: sudo apt-get install libcurl4-openssl-dev libssl-dev gcc gdal-bin libgdal-dev r-base-core -y | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get Python Version | |
id: full-python-version | |
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT | |
- name: Install Poetry | |
run: | | |
curl -sL https://install.python-poetry.org | python - -y ${{ matrix.bootstrap-args }} | |
- name: Update PATH | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Configure Poetry | |
run: poetry config virtualenvs.in-project true | |
- name: Configure cache | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Cache is healthy? | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: timeout 10s poetry run pip --version || rm -rf .venv | |
- name: Install Python Dependencies | |
run: poetry install --with dev | |
- name: Set up PostGIS | |
env: | |
PGPASSWORD: password | |
run: | | |
psql -d postgresql://postgres@localhost/template1 -f src/planscape/testing/postgis_setup.sql | |
- name: Run Tests | |
env: | |
SECRET_KEY: c25df907e3b95b0138b24f2bba3621f697d38196b0afe7a50c | |
run: | | |
cd src/planscape | |
poetry run python manage.py test . |