Skip to content

Commit

Permalink
[CI] Solr image: review suggestions (cron, image tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Dec 7, 2023
1 parent b7f4fb0 commit 61ac359
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions .github/workflows/gha-docker-solr.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Build and publish Solr Docker image
on:
workflow_dispatch: ~
workflow_dispatch:
inputs:
force:
default: false
required: false
type: boolean
description: "Push new image even when tests fail"
schedule:
- cron: "45 21 3 * *"

env:
IMAGE_NAME: ghcr.io/ibexa/core/solr
Expand All @@ -12,15 +20,43 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Add solr dependency
run: |
VERSION=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json)
composer require --no-update "ibexa/solr:$VERSION"
- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"

- name: Build Solr image
run: docker build -t "$IMAGE_NAME:latest" docker/solr

- name: Start Solr image
run: docker run -p 8983:8983 "$IMAGE_NAME:latest"

- name: Run Solr integration test suite
run: composer test-integration-solr
continue-on-error: ${{ inputs.force != '' }}
env:
CUSTOM_CACHE_POOL: singleredis
CACHE_HOST: 127.0.0.1
CORES_SETUP: single

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: docker build -t "$IMAGE_NAME:latest" docker/solr

- name: Push image
if: github.event_name == 'workflow_dispatch'
run: docker push "$IMAGE_NAME"

0 comments on commit 61ac359

Please sign in to comment.