Skip to content

Merge pull request #127 from qld-gov-au/develop #307

Merge pull request #127 from qld-gov-au/develop

Merge pull request #127 from qld-gov-au/develop #307

Workflow file for this run

name: CI
on:
push:
pull_request:
branches:
- master
jobs:
code_quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Check syntax
run: flake8
timeout-minutes: 5
test:
needs: code_quality
strategy:
matrix:
include:
- ckan-version: '2.11'
ckan-git-version: 'ckan-2.11.1'
ckan-git-org: 'ckan'
solr-version: 9
experimental: false
- ckan-version: '2.10'
ckan-git-version: 'ckan-2.10.6'
ckan-git-org: 'ckan'
solr-version: 8
experimental: false
- ckan-version: '2.10'
ckan-git-version: 'ckan-2.10.5-qgov.4'
ckan-git-org: 'qld-gov-au'
solr-version: 8
experimental: false
- ckan-version: '2.9'
ckan-git-version: 'ckan-2.9.9-qgov.4'
ckan-git-org: 'qld-gov-au'
solr-version: 8
experimental: false
- ckan-version: 'master'
ckan-git-org: 'ckan'
ckan-git-version: 'master'
solr-version: 9
experimental: true # master is unstable, good to know if we are compatible or not
fail-fast: false
name: CKAN ${{ matrix.ckan-version }} ${{ matrix.ckan-git-org }} ${{ matrix.ckan-git-version }}
runs-on: ubuntu-latest
container:
image: ckan/ckan-dev:${{ matrix.ckan-version }}
options: --user root
services:
solr:
image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr${{ matrix.solr-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
ports:
- 5432:5432
redis:
image: redis
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 6379:6379
moto:
image: motoserver/moto
ports:
- "5000"
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
CKAN_VERSION: ${{ matrix.ckan-version }}
CKAN_GIT_ORG: ${{ matrix.ckan-git-org }}
CKAN_GIT_VERSION: ${{ matrix.ckan-git-version }}
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
- name: Install requirements
continue-on-error: ${{ matrix.experimental }}
run: |
chmod u+x ./scripts/*
./scripts/build.sh
timeout-minutes: 15
- name: Setup CKAN
continue-on-error: ${{ matrix.experimental }}
run: ./scripts/init.sh
timeout-minutes: 15
- name: Run tests
continue-on-error: ${{ matrix.experimental }}
run: ./scripts/test.sh
timeout-minutes: 30
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "/tmp/junit/results.xml"
if: always()