Update README.md #19
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: Continuous integration tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
ci: | |
name: Continuous integration tests | |
runs-on: ubuntu-latest | |
services: | |
# Label used to access the service container | |
postgis: | |
# Docker Hub image | |
image: postgis/postgis:16-3.4-alpine | |
# Provide the password for postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready --health-interval 10s --health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Setup a local virtual environment (if no poetry.toml file) | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: | |
Define a cache for the virtual environment based on the dependencies | |
lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install the project dependencies | |
run: poetry install | |
# Create a PostGIS database (in a Docker container) for tests | |
- name: Run the automated tests | |
run: make test | |
env: | |
TOPO_TESTING_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/mapboard_topology_test |