Avoid deprecation (#12) #61
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: Tests | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install requirements | |
run: pip install -r dev-requirements.txt | |
- name: Check coding standards | |
run: flake8 . | |
test: | |
needs: lint | |
strategy: | |
matrix: | |
ckan-version: [2.9, 2.9-py2, 2.8] | |
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-dev:${{ matrix.ckan-version }} | |
postgres: | |
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }} | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
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@v2 | |
- name: Install system dependencies | |
run: sudo apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo | |
- name: Install requirements | |
run: | | |
pip install --upgrade pip | |
# scheming | |
pip install -e git+https://github.com/ckan/[email protected]#egg=ckanext-scheming | |
pip install -r https://raw.githubusercontent.com/ckan/ckanext-scheming/release-2.0.0/requirements.txt | |
# harvest | |
pip install -e git+https://github.com/ckan/[email protected]#egg=ckanext-harvest | |
pip install -r https://raw.githubusercontent.com/ckan/ckanext-harvest/v1.4.2/requirements.txt | |
# DDI | |
pip install -r requirements.txt | |
pip install -r dev-requirements.txt | |
pip install -e . | |
- name: Setup extension (CKAN >= 2.9) | |
if: ${{ matrix.ckan-version != '2.8' }} | |
run: | | |
ckan -c test.ini db init | |
ckan -c test.ini harvester initdb | |
- name: Setup extension (CKAN < 2.9) | |
if: ${{ matrix.ckan-version == '2.8' }} | |
run: | | |
paster --plugin=ckan db init -c test.ini | |
paster --plugin=ckanext-harvest harvester initdb -c test.ini | |
- name: Run tests | |
run: pytest --ckan-ini=test.ini --cov=ckanext.ddi --cov-report xml --disable-warnings ckanext/ddi/tests | |
- name: Upload coverage report to codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./coverage.xml |