Update django gcp #76
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: ci | |
on: | |
# Also on push so that codecov reports main branch coverage | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: "Enable tmate debug" | |
type: boolean | |
default: false | |
jobs: | |
run-tests: | |
if: "!contains(github.event.head_commit.message, 'skipci')" | |
strategy: | |
fail-fast: true | |
matrix: | |
python: ["3.9", "3.10"] | |
os: [ubuntu-latest] # [ubuntu-latest, windows-latest, macos-latest] for full coverage but this gets expensive quickly | |
runs-on: ${{ matrix.os }} | |
services: | |
postgres: | |
image: kartoza/postgis:13.0 | |
env: | |
POSTGRES_DB: postgres_db | |
POSTGRES_USER: postgres_user | |
POSTGRES_PASSWORD: postgres_password | |
POSTGRES_MULTIPLE_EXTENSIONS: postgis,hstore,postgis_topology,postgis_raster,pgrouting | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
# See the repo of this action for way more advanced caching strategies than used here | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
# For more advanced configuration see https://github.com/ymyzk/tox-gh-actions | |
- name: Install tox and plugins | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox==3.24.5 tox-gh-actions==2.9.1 tox-poetry==0.4.1 | |
- name: Setup tmate session [DEBUG] | |
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true'}} | |
uses: mxschmitt/action-tmate@v3 | |
# For more advanced configuration see https://github.com/ymyzk/tox-gh-actions | |
- name: Run tests using tox | |
run: tox | |
- name: Upload coverage to Codecov | |
# This seems redundant inside the test matrix but actually isn't, since different | |
# dependency combinations may cause different lines of code to be hit (e.g. backports) | |
uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.xml | |
fail_ci_if_error: true |