Skip to content

Commit

Permalink
[QOLDEV-1020] simplify GitHub Actions workflow
Browse files Browse the repository at this point in the history
- Use vanilla CKAN container instead of Docker Compose + Ahoy
  • Loading branch information
ThrawnCA committed Nov 25, 2024
1 parent d65e8b5 commit 18c8180
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,51 +34,66 @@ jobs:

name: Test on CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-latest
container: drevops/ci-runner:23.12.0
container:
image: ckan/ckan-dev:${{ matrix.ckan-version }}
options: --user root
services:
solr:
image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr9
postgres:
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:3
env:
CKAN_VERSION: ${{ matrix.ckan-version }}

steps:
# Patch https://github.com/actions/runner/issues/863
- name: Preserve $HOME set in the container
run: echo HOME=/root >> "$GITHUB_ENV"

- uses: actions/checkout@v4
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 2

- name: Build
- name: Install requirements
continue-on-error: ${{ matrix.experimental }}
run: bin/build.sh
run: bin/init-ext.sh
timeout-minutes: 15

- name: Unit test
continue-on-error: ${{ matrix.experimental }}
run: bin/test.sh
run: |
pytest --ckan-ini=$CKAN_INI --cov=ckanext --junit-xml=test/junit/results.xml
timeout-minutes: 10

- name: Create sample data
continue-on-error: ${{ matrix.experimental }}
run: bin/create-test-data.sh

- name: Scenario test
continue-on-error: ${{ matrix.experimental }}
run: bin/test-bdd.sh
run: |
mailmock -p 8025 -o test/emails &
sleep 5
behave --junit -k test/features --tags=smoke --junit-directory=test/junit/ && \
behave --junit -k test/features --tags=-smoke --junit-directory=test/junit/
timeout-minutes: 30

- name: Retrieve logs
if: always()
run: ahoy logs
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 1

- name: Retrieve results
if: always()
run: bin/process-artifacts.sh
uses: jwalton/gh-docker-logs@v2
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 1

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

- name: Upload screenshots
Expand All @@ -87,5 +102,5 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
with:
name: CKAN ${{ matrix.ckan-version }} screenshots
path: /tmp/artifacts/behave/screenshots
path: test/screenshots
timeout-minutes: 1

0 comments on commit 18c8180

Please sign in to comment.