Skip to content

Instantly share code, notes, and snippets.

@bellisk
Last active June 20, 2023 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bellisk/28c7bb6492b7e5c04f7e5cb240f6da66 to your computer and use it in GitHub Desktop.
Save bellisk/28c7bb6492b7e5c04f7e5cb240f6da66 to your computer and use it in GitHub Desktop.
name: Tests
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
ckan-version: ["2.10", 2.9]
fail-fast: false
name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-latest
container:
image: openknowledge/ckan-dev:${{ matrix.ckan-version }}
services:
solr:
image: ckan/ckan-solr:${{ matrix.ckan-version }}
postgres:
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:3
env:
CKAN_SQLALCHEMY_URL: postgresql://ckan_default:pass@postgres/ckan_test
CKAN_DATASTORE_WRITE_URL: postgresql://datastore_write:pass@postgres/datastore_test
CKAN_DATASTORE_READ_URL: postgresql://datastore_read:pass@postgres/datastore_test
CKAN_SOLR_URL: http://solr:8983/solr/ckan
CKAN_REDIS_URL: redis://redis:6379/1
steps:
- uses: actions/checkout@v3
- name: Install requirements and set up ckanext
run: |
/bin/install_test_requirements.sh ${{ matrix.ckan-version }}
- name: Run tests
run: |
pytest --ckan-ini=test.ini --cov=ckanext.example --disable-warnings ckanext/example/tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment