Destroy Ganon, Rescue Princess #66
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: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: 'Enable tmate debug' | |
type: boolean | |
default: 'false' | |
jobs: | |
check-semantic-version: | |
if: "!contains(github.event.head_commit.message, 'skipci')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
# Set fetch-depth to 0 to fetch all tags (necessary for git-mkver to determine the correct semantic version). | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
- name: Install git-mkver | |
run: | | |
curl -L https://github.com/idc101/git-mkver/releases/download/v1.2.1/git-mkver-linux-amd64-1.2.1.tar.gz \ | |
| tar xvz \ | |
&& sudo mv git-mkver /usr/local/bin | |
- name: Install semantic version checker | |
run: pip install git+https://github.com/octue/conventional-commits | |
- name: Check version | |
run: check-semantic-version pyproject.toml | |
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@v1 | |
with: | |
file: coverage.xml | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |