Generate a dynamic matrix of test names for Selenium tests

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2026-02-24 10:48:46 +01:00
parent 5139170303
commit 59c349958b
No known key found for this signature in database
GPG Key ID: 70684F4717D49A31

View File

@ -16,9 +16,25 @@ env:
node-version: "12"
jobs:
generate-matrix:
name: Generate the matrix of Selenium tests
if: "!contains(github.event.head_commit.message, '[ci selenium skip]')"
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.tests-list.outputs.tests }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- id: tests-list
name: Send test names to outputs
run: |
set -euo pipefail
TEST_NAMES="[$(find $PWD/test/selenium/ -type f -name '*Test.php' -print |sed -E "s,$PWD/test/selenium/(.*)Test.php,{\"test-name\": \"\1\"}," | paste -sd ",")]"
echo "tests=$(printf "$TEST_NAMES")" >> $GITHUB_OUTPUT
selenium:
name: "Selenium"
if: "!contains(github.event.head_commit.message, '[ci selenium skip]')"
needs: generate-matrix
runs-on: "ubuntu-latest"
services:
database-server:
@ -59,28 +75,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-name:
- "ChangePassword"
- "CreateDropDatabase"
- "CreateRemoveUser"
- "Database/Events"
- "Database/Operations"
- "Database/Procedures"
- "Database/Structure"
- "Export"
- "Import"
- "Login"
- "Normalization"
- "ServerSettings"
- "SqlQuery"
- "Table/Browse"
- "Table/Create"
- "Table/Insert"
- "Table/Operations"
- "Table/Structure"
- "Tracking"
- "Triggers"
- "Xss"
include: ${{ fromJSON(needs.generate-matrix.outputs.tests) }}
steps:
- name: Checkout code
uses: actions/checkout@v6