1+ ---
12name : Tests
23on :
34 push :
67 - master
78
89jobs :
10+ lint :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+ - uses : actions/setup-python@v5
15+ with :
16+ python-version : ' 3.10'
17+ - name : Install requirements
18+ run : pip install flake8 pycodestyle
19+ - name : Check syntax
20+ run : flake8
21+
922 test :
23+ needs : lint
1024 strategy :
11- matrix :
12- ckan-version : ["2.10", 2.9]
1325 fail-fast : false
26+ matrix :
27+ ckan-version : ["2.11", "2.10", 2.9]
28+ experimental : [false]
29+ include :
30+ - ckan-version : ' master'
31+ experimental : true # master is unstable, good to know if we are compatible or not
1432
33+ name : Test on CKAN ${{ matrix.ckan-version }}
1534 runs-on : ubuntu-latest
1635 container :
17- # The CKAN version tag of the Solr and Postgres containers should match
18- # the one of the container the tests run on.
19- # You can switch this base image with a custom image tailored to your project
20- image : openknowledge/ckan-dev:${{ matrix.ckan-version }}
36+ image : ckan/ckan-dev:${{ matrix.ckan-version }}
37+ options : --user root
2138 services :
2239 solr :
23- image : ckan/ckan-solr:${{ matrix.ckan-version }}
40+ image : ckan/ckan-solr:${{ matrix.ckan-version }}-solr9
2441 postgres :
2542 image : ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
2643 env :
3047 options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
3148 redis :
3249 image : redis:3
33-
3450 env :
3551 CKAN_SQLALCHEMY_URL : postgresql://ckan_default:pass@postgres/ckan_test
3652 CKAN_DATASTORE_WRITE_URL : postgresql://datastore_write:pass@postgres/datastore_test
@@ -39,25 +55,35 @@ jobs:
3955 CKAN_REDIS_URL : redis://redis:6379/1
4056
4157 steps :
42- - uses : actions/checkout@v4
43-
44- - name : Install lint requirements
45- run : pip install flake8 pycodestyle
46- - name : Check syntax
47- run : flake8
48-
49- - name : Install requirements
50- # Install any extra requirements your extension has here (dev requirements, other extensions etc)
51- run : |
52- pip install -r requirements.txt
53- pip install -r dev-requirements.txt
54- pip install -e .
55- - name : Setup extension
56- # Extra initialization steps
57- run : |
58- # Replace default path to CKAN core config file with the one on the container
59- sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
60-
61- ckan -c test.ini db init
62- - name : Run tests
63- run : pytest --ckan-ini=test.ini --cov=ckanext.oidc_pkce --disable-warnings ckanext/oidc_pkce
58+ - uses : actions/checkout@v4
59+ continue-on-error : ${{ matrix.experimental }}
60+
61+ - if : ${{ matrix.ckan-version == 2.9 }}
62+ continue-on-error : ${{ matrix.experimental }}
63+ run : pip install "setuptools>=44.1.0,<71"
64+ - name : Install requirements
65+ continue-on-error : ${{ matrix.experimental }}
66+ # Install any extra requirements your extension has here (dev requirements, other extensions etc)
67+ run : |
68+ pip install -r requirements.txt
69+ pip install -r dev-requirements.txt
70+ pip install -e .
71+
72+ - name : Setup extension
73+ continue-on-error : ${{ matrix.experimental }}
74+ # Extra initialization steps
75+ run : |
76+ # Replace default path to CKAN core config file with the one on the container
77+ sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
78+ ckan -c test.ini db init
79+
80+ - name : Run tests
81+ continue-on-error : ${{ matrix.experimental }}
82+ run : pytest --ckan-ini=test.ini --cov=ckanext.oidc_pkce --disable-warnings ckanext/oidc_pkce --junit-xml=/tmp/artifacts/junit/results.xml
83+
84+ - name : Test Summary
85+ uses : test-summary/action@v2
86+ continue-on-error : ${{ matrix.experimental }}
87+ with :
88+ paths : " /tmp/artifacts/junit/*.xml"
89+ if : always()
0 commit comments