From d8cb8b3d47ae1136b205f4c59daa5b25ead71cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 7 Dec 2023 11:15:12 +0100 Subject: [PATCH 1/3] [CI] Renamed Solr workflow file --- .github/workflows/{solr.yaml => gha-docker-solr.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{solr.yaml => gha-docker-solr.yaml} (100%) diff --git a/.github/workflows/solr.yaml b/.github/workflows/gha-docker-solr.yaml similarity index 100% rename from .github/workflows/solr.yaml rename to .github/workflows/gha-docker-solr.yaml From 459748809fd73bb3c278a1f81dcc5ba49a781846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 7 Dec 2023 11:45:18 +0100 Subject: [PATCH 2/3] [CI] Solr image: review suggestions (cron, image tests) --- .github/workflows/gha-docker-solr.yaml | 60 +++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gha-docker-solr.yaml b/.github/workflows/gha-docker-solr.yaml index fc76c9559f..7e568a6e8f 100644 --- a/.github/workflows/gha-docker-solr.yaml +++ b/.github/workflows/gha-docker-solr.yaml @@ -1,26 +1,74 @@ 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 jobs: build-and-publish: - runs-on: ubuntu-latest + runs-on: "ubuntu-20.04" permissions: packages: write + services: + redis: + image: redis + ports: + - 6379:6379 + options: + --memory=60m steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Build Solr image + run: docker build -t "$IMAGE_NAME:latest" docker/solr + + - name: Start Solr image + run: | + docker run --health-cmd "solr status" \ + --health-interval 10s --health-timeout 5s --health-retries 10 \ + -d -p 8983:8983 "$IMAGE_NAME:latest" + + - name: Setup PHP Action + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + 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@v2" + with: + dependency-versions: "highest" + + - name: Run 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" From 06bdf3a8ad4afeebd915899816a4bf518acf731a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 6 Feb 2024 09:12:01 +0100 Subject: [PATCH 3/3] Applied suggestion: CS Co-authored-by: Konrad Oboza --- .github/workflows/gha-docker-solr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gha-docker-solr.yaml b/.github/workflows/gha-docker-solr.yaml index 7e568a6e8f..f32cb9525f 100644 --- a/.github/workflows/gha-docker-solr.yaml +++ b/.github/workflows/gha-docker-solr.yaml @@ -17,7 +17,7 @@ jobs: build-and-publish: runs-on: "ubuntu-20.04" permissions: - packages: write + packages: write services: redis: image: redis