1+ name : ci
2+
13on :
24 pull_request :
35 branches :
46 - main
7+ workflow_dispatch :
8+ inputs :
9+ debug_enabled :
10+ description : " Enable tmate debug"
11+ type : boolean
12+ default : " false"
513
614jobs :
715 check-semantic-version :
@@ -34,23 +42,26 @@ jobs:
3442 strategy :
3543 fail-fast : true
3644 matrix :
37- python : ["3.6", "3.7", "3.8", "3.9"]
38- django : ["2.2", "3.0", "3.1"]
45+ python : ["3.8", "3.9", "3.10"]
3946 os : [ubuntu-latest] # [ubuntu-latest, windows-latest, macos-latest] for full coverage but this gets expensive quickly
4047 runs-on : ${{ matrix.os }}
48+
4149 services :
42- # See: https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
43- pg_host :
44- image : postgres:13.0
50+ postgres :
51+ image : kartoza/postgis:13.0
4552 env :
46- POSTGRES_DB : pg_db
47- POSTGRES_USER : pg_user
48- POSTGRES_PASSWORD : pg_password
53+ POSTGRES_DB : postgres_db
54+ POSTGRES_USER : postgres_user
55+ POSTGRES_PASSWORD : postgres_password
56+ POSTGRES_MULTIPLE_EXTENSIONS : postgis,hstore,postgis_topology,postgis_raster,pgrouting
57+ ports :
58+ - 5432:5432
4959 options : >-
5060 --health-cmd pg_isready
5161 --health-interval 10s
5262 --health-timeout 5s
5363 --health-retries 5
64+
5465 steps :
5566 - name : Checkout Repository
5667 uses : actions/checkout@v2
@@ -67,13 +78,16 @@ jobs:
6778 # For more advanced configuration see https://github.com/ymyzk/tox-gh-actions
6879 - name : Install tox and plugins
6980 run : |
70- pip install --upgrade pip
71- pip install tox@^3.24.5 tox-gh-actions@^2.9.1 tox-poetry@^0.4.1
81+ python -m pip install --upgrade pip
82+ python -m pip install tox==3.24.5 tox-gh-actions==2.9.1 tox-poetry==0.4.1
83+
84+ - name : Setup tmate session [DEBUG]
85+ if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true'}}
86+ uses : mxschmitt/action-tmate@v3
7287
88+ # For more advanced configuration see https://github.com/ymyzk/tox-gh-actions
7389 - name : Run tests using tox
7490 run : tox
75- env :
76- DATABASE_URL : postgresql://pg_user:pg_password@pg_host/pg_db
7791
7892 - name : Upload coverage to Codecov
7993 # This seems redundant inside the test matrix but actually isn't, since different
8397 file : coverage.xml
8498 fail_ci_if_error : true
8599 token : ${{ secrets.CODECOV_TOKEN }}
86-
87- test-publish :
88- if : " !contains(github.event.head_commit.message, 'skipci')"
89- runs-on : ubuntu-latest
90- needs : [check-semantic-version, run-tests]
91- steps :
92- - name : Checkout Repository
93- uses : actions/checkout@v2
94-
95- - name : Test package is publishable with PyPI test server
96- 97- with :
98- python_version : " 3.9"
99- pypi_token : ${{ secrets.TEST_PYPI_TOKEN }}
100- repository_name : " testpypi"
101- repository_url : " https://test.pypi.org/legacy/"
102- skip_existing : true
0 commit comments