Server main to master #42
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: "Tests and Checks" | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
python: ["3.10"] #3.10 | |
runs-on: ubuntu-22.04 #ubuntu:jammy-20231004 | |
# container: "python:${{matrix.python}}-slim-buster" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update apt-get sources | |
run: sudo apt-get update | |
- name: Install PostgreSQL, PostGIS and GDAL | |
run: > | |
sudo apt-get install -y | |
gdal-bin | |
python3-gdal | |
postgis | |
postgresql | |
postgresql-client | |
postgresql-postgis | |
libpq-dev | |
build-essential | |
- name: Start PostgreSQL server | |
run: sudo /etc/init.d/postgresql start | |
- name: Allow runner to create PostgreSQL databases | |
run: sudo su - postgres -c "createuser --createdb runner" | |
- name: Create PostGIS extension | |
run: > | |
sudo su - postgres | |
-c "psql template1 -c 'create extension postgis'" | |
- name: Install Tox and tox-gh-actions | |
run: pip install tox tox-gh-actions | |
- name: Test with Tox | |
run: tox | |
- name: Upload coverage data to codecov.io | |
uses: codecov/codecov-action@v3 | |
test-dockerization: | |
runs-on: ubuntu-22.04 #ubuntu:jammy-20231004 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Docker | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker image of the app | |
run: docker-compose build | |
- name: Start the services with docker-compose up | |
run: docker-compose up -d | |
- name: Run pytest in the app container | |
run: USE_DOCKER=1 ./run-pytest -vvv | |
checks: | |
strategy: | |
matrix: | |
toxenv: [style, requirements, sanitizer] | |
runs-on: ubuntu-22.04 #ubuntu:jammy-20231004 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v3.1.2 | |
with: | |
python-version: "3.10" #3.10 | |
- name: Install GDAL | |
run: sudo apt-get install -y gdal-bin | |
if: ${{ matrix.toxenv == 'sanitizer' }} | |
- name: Install Tox and tox-gh-actions | |
run: pip install tox tox-gh-actions | |
- name: Run the check with Tox | |
run: tox | |
env: | |
TOXENV: ${{matrix.toxenv}} |