From e39dd46f9c53a0d2625cd5d19ad1cf18565b8c5c Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Sun, 17 May 2026 17:40:33 -0400 Subject: [PATCH] feat(check-store): add smoke-test action and use resolve-check-config (#255) --- .github/workflows/check-store.yaml | 76 ++++++++++++++++++++++++++++-- docs/workflows/check-store.md | 18 +++++++ 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-store.yaml b/.github/workflows/check-store.yaml index 012d639..21e8e74 100644 --- a/.github/workflows/check-store.yaml +++ b/.github/workflows/check-store.yaml @@ -35,7 +35,7 @@ jobs: compute_matrix: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.supported-version.outputs.matrix }} + resolved: ${{ steps.resolve.outputs.resolved }} steps: - uses: actions/checkout@v6 if: inputs.store_artifact_name == '' @@ -57,11 +57,18 @@ jobs: kind: custom custom_versions: ${{ steps.get-magento-version.outputs.project }}:${{ fromJSON(steps.get-magento-version.outputs.version) }} + - uses: graycoreio/github-actions-magento2/resolve-check-config@main + id: resolve + with: + kind: store + matrix: ${{ steps.supported-version.outputs.matrix }} + unit-test: runs-on: ${{ matrix.os }} needs: compute_matrix + if: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['unit-test'].enabled != false }} strategy: - matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }} + matrix: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['unit-test'].matrix }} steps: - uses: actions/checkout@v6 @@ -122,8 +129,9 @@ jobs: coding-standard: runs-on: ${{ matrix.os }} needs: compute_matrix + if: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['coding-standard'].enabled != false }} strategy: - matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }} + matrix: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['coding-standard'].matrix }} steps: - uses: actions/checkout@v6 @@ -172,4 +180,64 @@ jobs: - uses: graycoreio/github-actions-magento2/coding-standard@main with: path: ${{ steps.setup-magento.outputs.path }} - composer_auth: ${{ secrets.composer_auth }} \ No newline at end of file + composer_auth: ${{ secrets.composer_auth }} + + smoke-test: + runs-on: ${{ matrix.os }} + needs: compute_matrix + if: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['smoke-test'].enabled != false }} + services: ${{ matrix.services }} + strategy: + matrix: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['smoke-test'].matrix }} + + steps: + - uses: actions/checkout@v6 + if: inputs.store_artifact_name == '' + + - uses: actions/download-artifact@v8 + if: inputs.store_artifact_name != '' + with: + name: ${{ inputs.store_artifact_name }} + path: ${{ inputs.path }} + + - uses: graycoreio/github-actions-magento2/setup-magento@main + id: setup-magento + with: + php-version: ${{ matrix.php }} + tools: composer:v${{ matrix.composer }} + mode: store + working-directory: ${{ inputs.path }} + composer_auth: ${{ secrets.composer_auth }} + + - uses: graycoreio/github-actions-magento2/cache-magento@main + with: + composer_cache_key: ${{ inputs.composer_cache_key }} + working-directory: ${{ steps.setup-magento.outputs.path }} + stamp: ${{ inputs.stamp }} + + - name: Composer install + working-directory: ${{ steps.setup-magento.outputs.path }} + run: composer install + env: + COMPOSER_AUTH: ${{ secrets.composer_auth }} + + - uses: graycoreio/github-actions-magento2/setup-install@main + id: setup-install + with: + services: ${{ toJSON(matrix.services) }} + path: ${{ steps.setup-magento.outputs.path }} + container_id: ${{ job.services['php-fpm'].id }} + extra_args: --magento-init-params=MAGE_MODE=developer + + - uses: graycoreio/github-actions-magento2/configure-service-nginx@main + with: + container_id: ${{ job.services.nginx.id }} + magento_path: ${{ inputs.path }} + + - uses: graycoreio/github-actions-magento2/smoke-test@main + with: + kind: page + + - uses: graycoreio/github-actions-magento2/smoke-test@main + with: + kind: graphql \ No newline at end of file diff --git a/docs/workflows/check-store.md b/docs/workflows/check-store.md index 1a3965c..6507eb8 100644 --- a/docs/workflows/check-store.md +++ b/docs/workflows/check-store.md @@ -24,6 +24,24 @@ See the [check-store.yaml](../../.github/workflows/check-store.yaml) - **Unit Tests** — runs PHPUnit against custom code in `app/code`. Skipped automatically if no test files are found. - **Coding Standard** — runs the Magento Coding Standard against `app/code`. Uses your `phpcs.xml` (or `.phpcs.xml`, `phpcs.xml.dist`, `.phpcs.xml.dist`) if one exists, otherwise a sensible default is generated. +- **Smoke Test** — boots your store against the supported-version service set (mysql, search, queue, cache, nginx, php-fpm) and runs the smoke probes against it. + +## Configuration + +Each check can be toggled on/off through an optional `.github/check-store.json` file in the repo that calls this workflow. + +You can learn more about this file here in the [`resolve-check-config` action.](../../resolve-check-config/README.md): + +Reference the published JSON Schema with `$schema` to get autocompletion and inline validation in editors that support it: + +```json +{ + "$schema": "https://raw.githubusercontent.com/graycoreio/github-actions-magento2/main/resolve-check-config/check-store.schema.json", + "jobs": { + "coding-standard": false + } +} +``` ## Usage