Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/php-quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ on:
required: false
default: "opensearchproject/opensearch"

opensearch-plugins:
description: >-
Space-separated OpenSearch plugins to install into the search service
before tests run (e.g., "analysis-icu analysis-phonetic")
type: string
required: false
default: ""

jobs:
# Install Composer dependencies with caching and detect available tools
install:
Expand Down Expand Up @@ -804,6 +812,22 @@ jobs:
[ -d "pub" ] && echo " ✅ pub/"
fi

- name: Install OpenSearch plugins
if: inputs.opensearch-plugins != ''
env:
OPENSEARCH_PLUGINS: ${{ inputs.opensearch-plugins }}
SEARCH_CONTAINER_ID: ${{ job.services.search.id }}
run: |
echo "🔌 Installing OpenSearch plugins: $OPENSEARCH_PLUGINS"
for plugin in $OPENSEARCH_PLUGINS; do
docker exec "$SEARCH_CONTAINER_ID" \
bin/opensearch-plugin install --batch "$plugin"
done
docker restart "$SEARCH_CONTAINER_ID"
echo "⏳ Waiting for OpenSearch to restart..."
timeout 120 bash -c 'until curl -sf http://localhost:9200/_cluster/health; do sleep 3; done'
echo "✅ OpenSearch is up with plugins installed"

- name: Run Integration Tests
run: |
echo "🔗 Running integration tests..."
Expand Down Expand Up @@ -931,6 +955,22 @@ jobs:
[ -d "pub" ] && echo " ✅ pub/"
fi

- name: Install OpenSearch plugins
if: inputs.opensearch-plugins != ''
env:
OPENSEARCH_PLUGINS: ${{ inputs.opensearch-plugins }}
SEARCH_CONTAINER_ID: ${{ job.services.search.id }}
run: |
echo "🔌 Installing OpenSearch plugins: $OPENSEARCH_PLUGINS"
for plugin in $OPENSEARCH_PLUGINS; do
docker exec "$SEARCH_CONTAINER_ID" \
bin/opensearch-plugin install --batch "$plugin"
done
docker restart "$SEARCH_CONTAINER_ID"
echo "⏳ Waiting for OpenSearch to restart..."
timeout 120 bash -c 'until curl -sf http://localhost:9200/_cluster/health; do sleep 3; done'
echo "✅ OpenSearch is up with plugins installed"

- name: Run REST API Tests
run: |
echo "🔌 Running REST API functional tests..."
Expand Down Expand Up @@ -1079,6 +1119,22 @@ jobs:
[ -d "pub" ] && echo " ✅ pub/"
fi

- name: Install OpenSearch plugins
if: inputs.opensearch-plugins != ''
env:
OPENSEARCH_PLUGINS: ${{ inputs.opensearch-plugins }}
SEARCH_CONTAINER_ID: ${{ job.services.search.id }}
run: |
echo "🔌 Installing OpenSearch plugins: $OPENSEARCH_PLUGINS"
for plugin in $OPENSEARCH_PLUGINS; do
docker exec "$SEARCH_CONTAINER_ID" \
bin/opensearch-plugin install --batch "$plugin"
done
docker restart "$SEARCH_CONTAINER_ID"
echo "⏳ Waiting for OpenSearch to restart..."
timeout 120 bash -c 'until curl -sf http://localhost:9200/_cluster/health; do sleep 3; done'
echo "✅ OpenSearch is up with plugins installed"

- name: Run GraphQL API Tests
run: |
echo "📊 Running GraphQL API functional tests..."
Expand Down
5 changes: 3 additions & 2 deletions docs/php-quality-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ A comprehensive PHP quality assurance workflow supporting static analysis, codin
| rabbitmq-version | ❌ | string | 4.1-management | RabbitMQ Docker image tag. |
| opensearch-image | ❌ | string | opensearchproject/opensearch | OpenSearch Docker image name, combined with `opensearch-version` as the tag. |
| opensearch-version | ❌ | string | 2 | OpenSearch Docker image tag. |
| opensearch-plugins | ❌ | string | "" | Space-separated OpenSearch plugins to install into the search service before tests run (e.g., `analysis-icu analysis-phonetic`). |
| **Advanced Configuration** |
| debug | ❌ | boolean | false | Enable verbose logging and debug output |

Expand Down Expand Up @@ -77,15 +78,15 @@ jobs:
phpstan-level: "9"
```

**Custom Service Images (e.g., OpenSearch with plugins):**
**OpenSearch with plugins (e.g., Adobe Commerce):**
```yaml
jobs:
magento-quality:
uses: aligent/workflows/.github/workflows/php-quality-checks.yml@main
with:
php-version: "8.4"
opensearch-image: "aligent/bitbucket-opensearch"
opensearch-version: "3.1.0"
opensearch-plugins: "analysis-icu analysis-phonetic"
```

**Magento project with pre-commit hook scripts (use-custom-config):**
Expand Down