Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change ckan-test to use ckan 2.11 #5122

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/ckan-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.10"
- name: Install requirements
run: pip install flake8 pycodestyle
- name: Run flake8
Expand All @@ -30,18 +30,19 @@ jobs:
test:
strategy:
matrix:
ckan-version: ["2.10", "2.10.1"]
ckan-version: ["2.11.0", "2.11"]
include:
- ckan-version: "2.10"
services-version: "2.10"
- ckan-version: "2.10.1"
services-version: "2.10"
- ckan-version: "2.11.0"
services-version: "2.11"
- ckan-version: "2.11"
services-version: "2.11"
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-latest
container:
image: openknowledge/ckan-dev:${{ matrix.ckan-version }}
image: ckan/ckan-dev:${{ matrix.ckan-version }}
options: --user root
services:
solr:
image: datagov/catalog.data.gov.solr:latest
Expand Down Expand Up @@ -74,25 +75,24 @@ jobs:
- uses: actions/checkout@v4
- name: Install requirements
run: |
sudo apk add tzdata swig python3-dev
sudo apk add proj-util proj-dev geos-dev
apt-get update && apt-get install -y libgeos-dev
cp /usr/share/zoneinfo/America/New_York /etc/localtime
if [[ -f requirements.txt ]]; then
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
if [[ -f dev-requirements.txt ]]; then
if [ -f dev-requirements.txt ]; then
pip install -r dev-requirements.txt
fi
pip install -e .
- name: Setup extension (CKAN >= 2.9)
run: |
ckan -c test.ini db init
if [[ $(cat requirements.txt | grep 'ckanext-harvest') ]]; then
ckan -c test.ini harvester initdb
if [ $(cat requirements.txt | grep 'ckanext-harvest') ]; then
ckan -c test.ini db upgrade -p harvest
fi
- name: Run tests
run: |
set -o pipefail
set -e
pytest --ckan-ini=test.ini --cov=ckanext.${{ inputs.ext_name }} --cov-fail-under=${CODE_COVERAGE_THRESHOLD_REQUIRED} --disable-warnings ckanext/${{ inputs.ext_name }}/tests | tee pytest-coverage.txt
- name: Report test coverage
if: ${{ always() }}
Expand Down