build & test (invoked by allynt) #137
This file contains hidden or 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: build | |
| run-name: build & test (invoked by ${{ github.actor }}) | |
| on: [push] | |
| jobs: | |
| app-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| continue-on-error: false | |
| services: | |
| grumpy-db: | |
| image: kartoza/postgis:latest | |
| env: | |
| POSTGRES_USER: grumpy_user | |
| POSTGRES_PASS: grumpy_pwd | |
| POSTGRES_DBNAME: grumpy_db | |
| ALLOW_IP_RANGE: 0.0.0.0/0 | |
| ports: | |
| - 5666:5432 | |
| steps: | |
| - name: "checkout repository" | |
| uses: actions/checkout@v5 | |
| - name: "install python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: "install uv" | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/pyproject.toml | |
| **/uv.lock | |
| version: "0.9.1" | |
| - name: "install dependencies" | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql-client python3-gdal | |
| uv sync --locked --dev | |
| - name: "run tests" | |
| env: | |
| DJANGO_ENVIRONMENT: "ci" | |
| DJANGO_SETTINGS_MODULE: "config.settings" | |
| DATABASE_URL: "postgis://grumpy_user:grumpy_pwd@localhost:5666/grumpy_db" | |
| run: uv run pytest |