Skip to content

feat(dev): temp circleci config; #865

feat(dev): temp circleci config;

feat(dev): temp circleci config; #865

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
# lint:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: '3.6'
# - name: Install requirements
# run: pip install flake8 pycodestyle
# - name: Check syntax
# run: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude ckan
test:
# needs: lint
strategy:
matrix:
ckan-version: [2.8]
fail-fast: false
name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-20.04
container:
image: openknowledge/ckan-dev:${{ matrix.ckan-version }}
services:
solr:
image: opendatacanada/solr
postgres:
image: postgres:9.6
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pass
POSTGRES_DB: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:3
env:
PGHOST: postgres
PGDATABASE: postgres
PGUSER: postgres
PGPASSWORD: pass
CKAN_POSTGRES_DB: ckan_test
CKAN_DATASTORE_POSTGRES_DB: datastore_test
CKAN_POSTGRES_USER: ckan_default
CKAN_DATASTORE_POSTGRES_READ_USER: datastore_read
CKAN_DATASTORE_POSTGRES_WRITE_USER: datastore_write
CKAN_POSTGRES_PWD: pass
CKAN_DATASTORE_POSTGRES_READ_PWD: pass
CKAN_DATASTORE_POSTGRES_WRITE_PWD: pass
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_registry
CKAN_REDIS_URL: redis://redis:6379/1
steps:
- uses: actions/checkout@v2
- name: Set CKAN to open-data/[email protected]
run: |
pip uninstall -y ckan
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ remote add canada https://github.com/open-data/ckan.git
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ fetch canada canada-v2.8
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ checkout -b canada-v2.8 canada/canada-v2.8
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ pull
- name: Install requirements
run: |
pip install -e \/srv\/app\/src\/ckan\/ -r \/srv\/app\/src\/ckan\/requirements.txt -r \/srv\/app\/src\/ckan\/dev-requirements.txt
pip install -e 'git+https://github.com/ckan/ckanapi.git#egg=ckanapi' -r 'https://raw.githubusercontent.com/ckan/ckanapi/master/requirements.txt'
pip install -e . -r .\/requirements.txt -r .\/test-requirements.txt
pip install -e 'git+https://github.com/open-data/ckanext-extendedactivity.git#egg=ckanext-extendedactivity'
pip install -e 'git+https://github.com/ckan/ckanext-fluent.git#egg=ckanext-fluent' -r 'https://raw.githubusercontent.com/ckan/ckanext-fluent/master/requirements.txt'
pip install -e 'git+https://github.com/open-data/ckanext-recombinant.git#egg=ckanext-recombinant' -r 'https://raw.githubusercontent.com/open-data/ckanext-recombinant/master/requirements.txt'
pip install -e 'git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming'
pip install -e 'git+https://github.com/open-data/ckanext-validation.git@canada#egg=ckanext-validation' -r 'https://raw.githubusercontent.com/open-data/ckanext-validation/canada/requirements.txt' -r 'https://raw.githubusercontent.com/open-data/ckanext-validation/canada/dev-requirements.txt'
pip install -e 'git+https://github.com/ckan/ckantoolkit.git#egg=ckantoolkit' -r 'https://raw.githubusercontent.com/ckan/ckantoolkit/master/requirements.txt'
pip install -e 'git+https://github.com/open-data/goodtables.git@canada#egg=goodtables' -r 'https://raw.githubusercontent.com/open-data/goodtables/canada/requirements.txt'
pip install -e 'git+https://github.com/open-data/ckanext-wet-boew.git#egg=ckanext-wet-boew' -r 'https://raw.githubusercontent.com/open-data/ckanext-wet-boew/master/requirements.txt'
- name: Setup extension (CKAN 2.8)
if: ${{ matrix.ckan-version == '2.8' }}
run: |
ln -s \/srv\/app\/src\/ckan\/test-core.ini .\/links\/test-core.ini
ln -s \/srv\/app\/src\/ckan\/who.ini .\/links\/who.ini
mkdir -p .\/links\/ckanext\/datastore\/tests\/ && ln -s \/srv\/app\/src\/ckan\/ckanext\/datastore\/tests\/allowed_functions.txt .\/links\/ckanext\/datastore\/tests\/allowed_functions.txt
mkdir -p .\/links\/ckan\/bin\/postgres_init\/ && ln -s \/srv\/app\/src\/ckan\/bin\/postgres_init\/1_create_ckan_db.sh .\/links\/ckan\/bin\/postgres_init\/1_create_ckan_db.sh && ln -s \/srv\/app\/src\/ckan\/bin\/postgres_init\/2_create_ckan_datastore_db.sh .\/links\/ckan\/bin\/postgres_init\/2_create_ckan_datastore_db.sh
python2 setup.py develop
. .\/links\/ckan\/bin\/postgres_init\/1_create_ckan_db.sh
. .\/links\/ckan\/bin\/postgres_init\/2_create_ckan_datastore_db.sh
paster --plugin=ckan db init -c test-core.ini
paster --plugin=ckan datastore set-permissions -c test-core.ini | psql -U postgres --set ON_ERROR_STOP=1
paster --plugin=ckanext-canada canada update-triggers -c test-core.ini
python2 .\/bin\/download_country.py
- name: Run all tests
run: |
nosetests --with-pylons=test-core.ini --nologcapture ckanext/canada/tests