Skip to content

Commit

Permalink
Merge pull request #116 from qld-gov-au/chore_container_uplift
Browse files Browse the repository at this point in the history
chore: use more unique tag, include test sumary in github actions
  • Loading branch information
duttonw authored Nov 21, 2024
2 parents d36cace + 2ef1ccb commit 402f1cc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,21 @@ jobs:
needs: lint
strategy:
matrix:
ckan-version: ["2.11", "2.10", 2.9]
include: #ckan-image see https://github.com/ckan/ckan-docker-base, ckan-version controls other image tags
- ckan-version: "2.11"
ckan-image: "2.11-py3.10"
- ckan-version: "2.10"
ckan-image: "2.10-py3.10"
- ckan-version: "2.9"
ckan-image: "2.9-py3.9"
#- ckan-version: "master" Publish does not care about master
# ckan-image: "master"
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-latest
container:
image: ckan/ckan-dev:${{ matrix.ckan-version }}
image: ckan/ckan-dev:${{ matrix.ckan-image }}
options: --user root
services:
solr:
Expand Down Expand Up @@ -99,7 +107,7 @@ jobs:
if: github.repository != 'ckan/ckanext-xloader'
steps:
- run: |
echo "Skipping PyPI publish on downstream repository"
echo "Skipping PyPI publish on downstream repository"
publish:
needs: test
Expand Down
39 changes: 34 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,25 @@ jobs:
needs: lint
strategy:
matrix:
ckan-version: ["2.11", "2.10", 2.9]
include: #ckan-image see https://github.com/ckan/ckan-docker-base, ckan-version controls other image tags
- ckan-version: "2.11"
ckan-image: "2.11-py3.10"
experimental: false
- ckan-version: "2.10"
ckan-image: "2.10-py3.10"
experimental: false
- ckan-version: "2.9"
ckan-image: "2.9-py3.9"
experimental: false
- ckan-version: "master"
ckan-image: "master"
experimental: true # master is unstable, good to know if we are compatible or not
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-latest
container:
image: ckan/ckan-dev:${{ matrix.ckan-version }}
image: ckan/ckan-dev:${{ matrix.ckan-image }}
options: --user root
services:
solr:
Expand All @@ -54,18 +66,35 @@ jobs:

steps:
- uses: actions/checkout@v4
- if: ${{ matrix.ckan-version == 2.9 }}
continue-on-error: ${{ matrix.experimental }}

- name: Pin setuptools for ckan 2.9 only
if: ${{ matrix.ckan-version == 2.9 }}
run: pip install "setuptools>=44.1.0,<71"
continue-on-error: ${{ matrix.experimental }}

- name: Install requirements
continue-on-error: ${{ matrix.experimental }}
run: |
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install -e .
pip install -U requests[security]
# 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
- name: Setup extension (CKAN >= 2.9)
- name: Setup extension
continue-on-error: ${{ matrix.experimental }}
run: |
ckan -c test.ini db init
- name: Run tests
run: pytest --ckan-ini=test.ini --cov=ckanext.xloader --disable-warnings ckanext/xloader/tests
continue-on-error: ${{ matrix.experimental }}
run: pytest --ckan-ini=test.ini --cov=ckanext.xloader --disable-warnings ckanext/xloader/tests --junit-xml=/tmp/artifacts/junit/results.xml

- name: Test Summary
uses: test-summary/action@v2
continue-on-error: ${{ matrix.experimental }}
with:
paths: "/tmp/artifacts/junit/*.xml"
if: always()

0 comments on commit 402f1cc

Please sign in to comment.