Skip to content

Refactor user app

Refactor user app #58

Workflow file for this run

name: Run tests
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_call:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-22.04
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: "Fetch code"
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: "Set up python 3.13"
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
- name: "Install pre-commit"
run: pip install pre-commit
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: "Cache pre-commit"
uses: actions/cache@v4
with:
path: "~/.cache/pre-commit"
key: ${{ runner.os }}-venv-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
#----------------------------------------------
# Run linters
#----------------------------------------------
- name: "Run linters"
run: pre-commit run -a
test:
runs-on: ubuntu-22.04
needs: lint
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: "Fetch code"
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: "Set up python 3.13"
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: "Install poetry"
uses: snok/install-poetry@v1
with:
version: 1.8.5
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: "Load poetry cache"
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# Install poetry and sys packages
#----------------------------------------------
- name: "Install dependencies"
run: poetry install
- name: "Install GDAL"
run: sudo apt-get install gdal-bin --no-install-suggests --no-install-recommends --yes --no-upgrade
#----------------------------------------------
# Run test
#----------------------------------------------
- name: "Run tests"
run: poetry run pytest