forked from ckan/ckanext-xloader
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from qld-gov-au/develop
Develop to master
- Loading branch information
Showing
39 changed files
with
2,224 additions
and
1,534 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
#based on https://raw.githubusercontent.com/ckan/ckanext-scheming/master/.github/workflows/test.yml | ||
# alternative https://github.com/ckan/ckan/blob/master/contrib/cookiecutter/ckan_extension/%7B%7Bcookiecutter.project%7D%7D/.github/workflows/test.yml | ||
name: Tests | ||
on: [push, pull_request] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-18.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.9, 2.9-py2, 2.8, 2.7] | ||
fail-fast: false | ||
|
||
name: CKAN ${{ matrix.ckan-version }} | ||
runs-on: ubuntu-18.04 | ||
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 requirements | ||
run: | | ||
pip install -r dev-requirements.txt | ||
pip install -r pip-requirements.txt | ||
pip install -e . | ||
# Replace default path to CKAN core config file with the one on the container | ||
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini | ||
#sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test_subclass.ini | ||
- name: Install Full Text Search | ||
run: | | ||
echo "Create full text function..." | ||
export PGPASSWORD=pass | ||
psql "postgresql://datastore_write:pass@postgres/datastore_test" -f full_text_function.sql | ||
- name: Setup extension (CKAN >= 2.9) | ||
if: ${{ matrix.ckan-version != '2.7' && matrix.ckan-version != '2.8' }} | ||
run: | | ||
ckan -c test.ini db init | ||
# ckan -c test.ini datastore set-permissions | sudo -u postgres psql -p $PG_PORT | ||
- name: Setup extension (CKAN < 2.9) | ||
if: ${{ matrix.ckan-version == '2.7' || matrix.ckan-version == '2.8' }} | ||
run: | | ||
paster --plugin=ckan db init -c test.ini | ||
# paster datastore set-permissions -c test-core.ini | sudo -u postgres psql -p $PG_PORT | ||
- name: Run all tests | ||
run: pytest --ckan-ini=test.ini --cov=ckanext.xloader ckanext/xloader/tests | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,77 @@ | ||
os: linux | ||
dist: focal | ||
language: python | ||
dist: bionic | ||
python: | ||
- "2.7" | ||
env: | ||
- CKAN_GIT_REPO=ckan CKAN_BRANCH=master | ||
- CKAN_GIT_REPO=ckan CKANVERSION=2.8 | ||
- CKAN_GIT_REPO=qld-gov-au CKAN_BRANCH=qgov-master | ||
|
||
services: | ||
- docker | ||
- redis | ||
- postgresql | ||
before_install: | ||
- apt-cache policy libmagic1 | ||
install: | ||
- pip install -U pip wheel | ||
- bash bin/travis-build.bash | ||
- pip install coveralls | ||
script: sh bin/travis-run.sh | ||
after_success: | ||
- coveralls | ||
|
||
install: bash bin/travis-build.bash | ||
script: bash bin/travis-run.bash | ||
|
||
stages: | ||
- Flake8 | ||
- test | ||
- Tests | ||
|
||
|
||
jobs: | ||
include: | ||
- stage: Flake8 | ||
python: 3.6 | ||
env: FLAKE8=True | ||
install: | ||
- pip install -U pip wheel | ||
- sh bin/travis-flake.sh | ||
- pip install flake8==3.5.0 | ||
- pip install pycodestyle==2.3.0 | ||
script: | ||
- sh bin/travis-flake-run.sh | ||
- stage: test #master build on python 3 alpha | ||
env: CKAN_GIT_REPO=ckan CKAN_BRANCH=master | ||
- flake8 --version | ||
# stop the build if there are Python syntax errors or undefined names | ||
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude ckan | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
- flake8 . --count --max-line-length=127 --statistics --exclude ckan --exit-zero | ||
|
||
|
||
- stage: Tests | ||
python: "3.6" | ||
- stage: test #2.7 build on trusty | ||
# ensure https://travis-ci.org/github/$yourRepo/ckanext-xloader/settings "Enable build config validation" is off if builds are not getting to testing | ||
# the new trusty images of Travis cause build errors with psycopg2 in 2.7 and below, see https://github.com/travis-ci/travis-ci/issues/8897 | ||
# due to psycopg2 2.4 does not support newer db's, https://github.com/psycopg/psycopg2/issues/594 and no backports being given to 2.7 or older | ||
# releases, we need ot hard lock for them. (needs to be on libpq-dev=9.3.* ) | ||
dist: trusty | ||
group: deprecated-2017Q4 #must be upper case but travis "build config validation" if enabled will lowercase it and break the build | ||
env: CKAN_GIT_REPO=ckan CKANVERSION=2.7 | ||
env: CKAN_GIT_REPO=ckan CKANVERSION=2.9 | ||
addons: | ||
postgresql: '12' | ||
apt: | ||
sources: | ||
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main' | ||
packages: | ||
- postgresql-12 | ||
|
||
|
||
- python: "2.7" | ||
env: CKAN_GIT_REPO=ckan CKANVERSION=2.9 | ||
addons: | ||
postgresql: '12' | ||
apt: | ||
sources: | ||
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main' | ||
packages: | ||
- postgresql-12 | ||
|
||
- python: "2.7" | ||
env: CKAN_GIT_REPO=qld-gov-au CKANVERSION=2.8 | ||
addons: | ||
postgresql: "9.6" | ||
- stage: test #2.8 build on trusty | ||
# ensure https://travis-ci.org/github/$yourRepo/ckanext-xloader/settings "Enable build config validation" is off if builds are not getting to testing | ||
# the new trusty images of Travis cause build errors with psycopg2 in 2.7 and below, see https://github.com/travis-ci/travis-ci/issues/8897 | ||
# due to psycopg2 2.4 does not support newer db's, https://github.com/psycopg/psycopg2/issues/594 and no backports being given to 2.7 or older | ||
# releases, we need ot hard lock for them. (needs to be on libpq-dev=9.3.* ) | ||
dist: trusty | ||
group: deprecated-2017Q4 #must be upper case but travis "build config validation" if enabled will lowercase it and break the build | ||
env: CKAN_GIT_REPO=ckan CKANVERSION=2.8 | ||
postgresql: '11' | ||
apt: | ||
sources: | ||
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main' | ||
packages: | ||
- postgresql-11 | ||
|
||
- python: "2.7" | ||
env: CKANVERSION=2.7 | ||
addons: | ||
postgresql: "9.6" | ||
allow_failures: | ||
- env: CKAN_GIT_REPO=ckan CKAN_BRANCH=master | ||
python: "3.6" | ||
- env: CKAN_GIT_REPO=ckan CKAN_BRANCH=master | ||
python: "2.7" #master build on python 2 alpha (is it backwards compatible) | ||
postgresql: '9.6' | ||
apt: | ||
sources: | ||
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main' | ||
packages: | ||
- postgresql-9.6 | ||
|
||
cache: pip | ||
cache: | ||
directories: | ||
- $HOME/.cache/pip |
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
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
Oops, something went wrong.