From ea40f8d1e2d4c85a01444f3a40f8e5647fd7ad8b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Oct 2026 21:45:46 +0000 Subject: [PATCH] CI: use the Joomla matrix of the plugin repository The integration job had a matrix of its own (Joomla 5.4.8, 6.1.3), which fell behind when the plugin repository moved its matrix into tests/ci/matrix.json and began to raise it automatically. A first job now chooses the plugin branch, as the integration jobs did before, and reads the matrix from that checkout, so both repositories test the same combinations and the matrix is maintained in one place. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AFJFMQjNKE7oxxSjxXsRiQ --- .github/workflows/ci.yml | 64 +++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16722a2..92c3a73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,32 +54,18 @@ jobs: - name: Check PHP syntax run: find . -name '*.php' -not -path './.git/*' -print0 | xargs -0 -n1 php -l - integration: - name: Joomla ${{ matrix.joomla }}, ${{ matrix.db }}, PHP ${{ matrix.php }} + # The Joomla!/PHP/database combinations are those of the plugin repository + # (tests/ci/matrix.json there), so that both repositories test the same + # combinations and the matrix is raised in one place only. The plugin branch + # is chosen here, once, so that the matrix and the code tested come from the + # same checkout. + matrix: + name: Test matrix runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - { joomla: 5.4.8, php: '8.2', db: 'mysql:8.0' } - - { joomla: 5.4.8, php: '8.2', db: 'postgres:12' } - - { joomla: 6.1.3, php: '8.4', db: 'mariadb:11.4' } - - { joomla: 6.1.3, php: '8.4', db: 'postgres:17' } - env: - JOOMLA_VERSION: ${{ matrix.joomla }} - DB_HOST: 127.0.0.1 - DB_NAME: joomla - DB_PASS: bfstop-test + outputs: + matrix: ${{ steps.read.outputs.matrix }} + plugin-ref: ${{ steps.plugin.outputs.ref }} steps: - - name: Set paths - run: | - { - echo "JOOMLA_ROOT=$RUNNER_TEMP/joomla" - echo "COM_BFSTOP_ROOT=$GITHUB_WORKSPACE" - echo "PLUGIN_ROOT=$RUNNER_TEMP/bfstop" - } >> "$GITHUB_ENV" - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - # use the plugin's branch of the same name if there is one and it # has commits main hasn't (for changes spanning both), else main: a # branch which was merged and not deleted is a stale copy of an old main @@ -104,6 +90,36 @@ jobs: with: repository: codeling/bfstop ref: ${{ steps.plugin.outputs.ref }} + sparse-checkout: tests/ci + - id: read + run: | + echo "matrix=$(jq -c '{include: .include}' tests/ci/matrix.json)" >> "$GITHUB_OUTPUT" + + integration: + name: Joomla ${{ matrix.joomla }}, ${{ matrix.db }}, PHP ${{ matrix.php }} + needs: matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} + env: + JOOMLA_VERSION: ${{ matrix.joomla }} + DB_HOST: 127.0.0.1 + DB_NAME: joomla + DB_PASS: bfstop-test + steps: + - name: Set paths + run: | + { + echo "JOOMLA_ROOT=$RUNNER_TEMP/joomla" + echo "COM_BFSTOP_ROOT=$GITHUB_WORKSPACE" + echo "PLUGIN_ROOT=$RUNNER_TEMP/bfstop" + } >> "$GITHUB_ENV" + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: codeling/bfstop + ref: ${{ needs.matrix.outputs.plugin-ref }} path: bfstop - name: Move bfstop checkout out of the component's run: mv bfstop "$PLUGIN_ROOT"