From 0bf08ef69291090e5fe3e3d47cb432c6c9107f30 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Sun, 17 May 2026 19:08:26 -0400 Subject: [PATCH] feat(check-extension): allow configuraton via .github/check-extension.json (#269) --- .github/workflows/check-extension.yaml | 23 ++++++++++++++++++++--- docs/workflows/check-extension.md | 17 +++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-extension.yaml b/.github/workflows/check-extension.yaml index afccbf9..d2cafc0 100644 --- a/.github/workflows/check-extension.yaml +++ b/.github/workflows/check-extension.yaml @@ -42,10 +42,23 @@ on: description: "Your composer credentials (typically a stringified json object of the contents of your auth.json)" jobs: + compute_resolved: + runs-on: ubuntu-latest + outputs: + resolved: ${{ steps.resolve.outputs.resolved }} + steps: + - uses: graycoreio/github-actions-magento2/resolve-check-config@main + id: resolve + with: + kind: extension + matrix: ${{ inputs.matrix }} + unit-test-extension: runs-on: ${{ matrix.os }} + needs: compute_resolved + if: ${{ fromJSON(needs.compute_resolved.outputs.resolved)['unit-test-extension'].enabled != false }} strategy: - matrix: ${{ fromJSON(inputs.matrix) }} + matrix: ${{ fromJSON(needs.compute_resolved.outputs.resolved)['unit-test-extension'].matrix }} fail-fast: ${{ inputs.fail-fast }} steps: - uses: actions/checkout@v6 @@ -113,8 +126,10 @@ jobs: compile-extension: runs-on: ${{ matrix.os }} + needs: compute_resolved + if: ${{ fromJSON(needs.compute_resolved.outputs.resolved)['compile-extension'].enabled != false }} strategy: - matrix: ${{ fromJSON(inputs.matrix) }} + matrix: ${{ fromJSON(needs.compute_resolved.outputs.resolved)['compile-extension'].matrix }} fail-fast: ${{ inputs.fail-fast }} steps: - uses: actions/checkout@v6 @@ -201,8 +216,10 @@ jobs: integration_test: runs-on: ${{ matrix.os }} + needs: compute_resolved + if: ${{ fromJSON(needs.compute_resolved.outputs.resolved)['integration_test'].enabled != false }} strategy: - matrix: ${{ fromJSON(inputs.matrix) }} + matrix: ${{ fromJSON(needs.compute_resolved.outputs.resolved)['integration_test'].matrix }} fail-fast: ${{ inputs.fail-fast }} services: ${{ matrix.services }} steps: diff --git a/docs/workflows/check-extension.md b/docs/workflows/check-extension.md index fe9bcd4..ef29af4 100644 --- a/docs/workflows/check-extension.md +++ b/docs/workflows/check-extension.md @@ -18,6 +18,23 @@ See the [check-extension.yaml](../../.github/workflows/check-extension.yaml) The Magento matrix format outlined by the [supported versions action.](https://github.com/graycoreio/github-actions-magento2/tree/main/supported-version/supported.json) +## Configuration + +Each check can be toggled on/off through an optional `.github/check-extension.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-extension.schema.json", + "jobs": { + "integration_test": false + } +} +``` + ## Usage ```yml