Skip to content

Commit

Permalink
Use conda for all jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet committed Feb 6, 2023
1 parent 2e1e6ac commit c2f7320
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
38 changes: 12 additions & 26 deletions .github/workflows/test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.8"]
python-version: [
{"pkg_name": "python==3.7", "flag": "3.7"},
{"pkg_name": "python==3.8", "flag": "3.8"},
{"pkg_name": "python==3.9", "flag": "3.9"},
{"pkg_name": "python==3.10", "flag": "3.10"},
{"pkg_name": "pypy3.8", "flag": "pypy3.8"},
]

# The type of runner that the job will run on
runs-on: ubuntu-22.04
Expand All @@ -47,26 +53,17 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Setup Python
- name: Set up Python ${{ matrix.python-version }}
if: ${{matrix.python-version != 'pypy-3.8'}}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64

# Setup Conda for Pypy

# Setup Conda for Python and Pypy
- name: Install Conda environment with Micromamba
if: ${{matrix.python-version == 'pypy-3.8'}}
if: ${{matrix.python-version == 'pypy3.8'}}
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: false
environment-name: test_pypy3.8
channels: conda-forge,defaults
cache-downloads: true
extra-specs: |
pypy3.8
${{ matrix.python-version.pkg_name }}
libspatialite>=5
# Config PostgreSQL
Expand All @@ -78,6 +75,7 @@ jobs:
# Add PostGIS extension to "gis" database
psql -h localhost -p 5432 -U gis -d gis -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
# Drop PostGIS Tiger Geocoder extension to "gis" database
psql -h localhost -p 5432 -U gis -d gis -c 'DROP EXTENSION IF EXISTS postgis_tiger_geocoder CASCADE;'
# Check python version
Expand All @@ -87,18 +85,6 @@ jobs:
# Install dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autotools-dev \
git \
libexpat1-dev \
libfreexl-dev \
libgeos-dev \
libproj-dev \
libreadline-dev \
libsqlite3-dev \
libsqlite3-mod-spatialite \
libxml2-dev \
zlib1g-dev
pip install --upgrade pip setuptools
pip install tox-gh-actions
Expand All @@ -116,7 +102,7 @@ jobs:
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel: true
flag-name: run-${{ matrix.python-version }}
flag-name: run-${{ matrix.python-version.flag }}


# This workflow aggregates coverages from all jobs and export it to Coveralls
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ python =
3.8: py38-sqla{14, latest}, lint
3.9: py39-sqla{14, latest}, docs
3.10: py310-sqla{14, latest}
pypy-3.8: pypy3-sqla{14, latest}
pypy3.8: pypy3-sqla{14, latest}

[testenv]
passenv=
Expand Down

0 comments on commit c2f7320

Please sign in to comment.