feat(check-store): add smoke-test action and use resolve-check-config (#255)

This commit is contained in:
Damien Retzinger
2026-05-17 17:40:33 -04:00
committed by GitHub
parent b98313e100
commit e39dd46f9c
2 changed files with 90 additions and 4 deletions
+71 -3
View File
@@ -35,7 +35,7 @@ jobs:
compute_matrix: compute_matrix:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
matrix: ${{ steps.supported-version.outputs.matrix }} resolved: ${{ steps.resolve.outputs.resolved }}
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
if: inputs.store_artifact_name == '' if: inputs.store_artifact_name == ''
@@ -57,11 +57,18 @@ jobs:
kind: custom kind: custom
custom_versions: ${{ steps.get-magento-version.outputs.project }}:${{ fromJSON(steps.get-magento-version.outputs.version) }} 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: unit-test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: compute_matrix needs: compute_matrix
if: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['unit-test'].enabled != false }}
strategy: strategy:
matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }} matrix: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['unit-test'].matrix }}
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
@@ -122,8 +129,9 @@ jobs:
coding-standard: coding-standard:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: compute_matrix needs: compute_matrix
if: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['coding-standard'].enabled != false }}
strategy: strategy:
matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }} matrix: ${{ fromJSON(needs.compute_matrix.outputs.resolved)['coding-standard'].matrix }}
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
@@ -173,3 +181,63 @@ jobs:
with: with:
path: ${{ steps.setup-magento.outputs.path }} path: ${{ steps.setup-magento.outputs.path }}
composer_auth: ${{ secrets.composer_auth }} 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
+18
View File
@@ -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. - **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. - **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 ## Usage