Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 13 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Tests
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.6.0
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.11'
- name: Install requirements
run: pip install flake8 pycodestyle
- name: Check syntax
Expand All @@ -20,20 +20,23 @@ jobs:
include:
- ckan-version: "2.11"
ckan-image: "ckan/ckan-dev:2.11-py3.10"
solr-version: "9"
- ckan-version: "2.10"
ckan-image: "ckan/ckan-dev:2.10-py3.10"
solr-version: "9"
- ckan-version: "2.9"
ckan-image: "ckan/ckan-dev:2.9-py3.9"
solr-version: "8"
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
container:
image: ${{ matrix.ckan-image }}
options: --user root
services:
solr:
image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr9
image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr${{ matrix.solr-version }}
postgres:
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
env:
Expand All @@ -52,13 +55,16 @@ jobs:
CKAN_REDIS_URL: redis://redis:6379/1

steps:
- uses: actions/checkout@v4.2.2
- uses: actions/checkout@v4
- name: Install requirements
# Install any extra requirements your extension has here (dev requirements, other extensions etc)
run: |
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install -e .
# Install unzip for SonarQube Scan
apt-get update
apt-get install unzip -y
- name: Setup extension
# Extra initialization steps
run: |
Expand All @@ -68,10 +74,6 @@ jobs:
ckan -c test.ini db init
- name: Run tests
run: pytest --ckan-ini=test.ini --cov=ckanext.sitemap --cov-report xml:coverage.xml --disable-warnings ckanext/sitemap

- name: Install unzip for SonarQube and cov
run: apt-get -y install unzip curl

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
with:
Expand Down
4 changes: 2 additions & 2 deletions ckanext/sitemap/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@


def _get_locales_from_config() -> Set:
locales_offered = tk.config.get('ckan.locales_offered')
filtered_out = tk.config.get('ckan.locales_filtered_out')
locales_offered = tk.aslist(tk.config.get('ckan.locales_offered'))
filtered_out = tk.aslist(tk.config.get('ckan.locales_filtered_out'))
locale_default = [tk.config.get('ckan.locale_default', 'en')]

all_locales = set(locales_offered)
Expand Down