Skip to content

Commit

Permalink
modify test workflow to use ghcr package defined by dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
smnorris committed Jul 31, 2024
1 parent a791aba commit 627204d
Showing 1 changed file with 6 additions and 38 deletions.
44 changes: 6 additions & 38 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Tests

name: Test
on:
push:
branches: [ main]
Expand All @@ -18,10 +17,10 @@ on:
- 'source.schema.json'
- 'sources.json'
jobs:
docker_tests:
test:
runs-on: ubuntu-latest
name: Docker | GDAL=${{ matrix.gdal-version }} | python=${{ matrix.python-version }}
container: ghcr.io/osgeo/gdal:ubuntu-small-${{ matrix.gdal-version }}
name: test
container: ghcr.io/bcgov/harvest-restrictions:main
services:
postgres:
image: postgis/postgis:16-3.4
Expand All @@ -37,42 +36,11 @@ jobs:
DEBIAN_FRONTEND: noninteractive
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.11'
gdal-version: '3.7.3'
- python-version: '3.12'
gdal-version: '3.9.1'

steps:
- uses: actions/checkout@v4

- name: Update and install postgresql client
run: |
apt-get update
apt-get -y install software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update
- name: Set up Python ${{ matrix.python-version }}
run: |
apt-get install -y --no-install-recommends \
python${{ matrix.python-version }} \
python${{ matrix.python-version }}-dev \
python${{ matrix.python-version }}-venv \
python3-pip \
g++
- name: Install dependencies
run: |
python${{ matrix.python-version }} -m venv testenv
. testenv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
- name: Run tests
run: |
. testenv/bin/activate
. venv/bin/activate
python -m pytest -v -rxXs
env:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres

0 comments on commit 627204d

Please sign in to comment.