From e0cc51bc0b4fb7b1c6a5d8dda84aceba585ba2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 12 Oct 2025 20:55:25 +0200 Subject: [PATCH 1/5] Add reusable CS workflow --- worflows/CS.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 worflows/CS.yml diff --git a/worflows/CS.yml b/worflows/CS.yml new file mode 100644 index 0000000..03d3cf1 --- /dev/null +++ b/worflows/CS.yml @@ -0,0 +1,57 @@ +name: CS (Code Style) + +on: + workflow_call: + inputs: + php-version: + type: string + required: false + default: '8.4' + composer-validate: + type: boolean + required: false + default: true + php-cs-fixer-args: + type: string + required: false + default: '--diff --dry-run' + +jobs: + cs: + name: "Code Style (PHP ${{ inputs.php-version }})" + runs-on: ubuntu-latest + + steps: + - name: "Checkout repository" + uses: actions/checkout@v4 + + - name: "Setup PHP ${{ inputs.php-version }}" + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ inputs.php-version }} + coverage: none + tools: php-cs-fixer, composer + + - name: "Cache Composer dependencies" + uses: actions/cache@v4 + with: + path: ~/.composer/cache + key: composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + restore-keys: composer-${{ runner.os }}- + + - name: "Composer validate" + if: inputs.composer-validate == true + run: composer validate --strict + + - name: "Composer install" + run: composer install --no-interaction --prefer-dist --no-progress + + - name: "Run PHP-CS-Fixer" + run: | + if [ -x vendor/bin/php-cs-fixer ]; then + BIN=vendor/bin/php-cs-fixer + else + BIN=php-cs-fixer + fi + $BIN -V + $BIN fix ${{ inputs.php-cs-fixer-args }} From 9b5010a54046198eac2614dadb388e5b83798006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 12 Oct 2025 20:59:49 +0200 Subject: [PATCH 2/5] Fix workflows path --- {worflows => workflows}/CS.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {worflows => workflows}/CS.yml (100%) diff --git a/worflows/CS.yml b/workflows/CS.yml similarity index 100% rename from worflows/CS.yml rename to workflows/CS.yml From 72404599be7b1dd314a057ea273d66c63f873e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 12 Oct 2025 21:56:00 +0200 Subject: [PATCH 3/5] Double .github for workflow path (#3) --- {workflows => .github/workflows}/CS.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {workflows => .github/workflows}/CS.yml (100%) diff --git a/workflows/CS.yml b/.github/workflows/CS.yml similarity index 100% rename from workflows/CS.yml rename to .github/workflows/CS.yml From 9f60e361b53b065f930f65b983a738f8d7708628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 12 Oct 2025 21:57:02 +0200 Subject: [PATCH 4/5] Double .github for worflow path (#4) --- {workflows => .github/workflows}/SA.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {workflows => .github/workflows}/SA.yml (100%) diff --git a/workflows/SA.yml b/.github/workflows/SA.yml similarity index 100% rename from workflows/SA.yml rename to .github/workflows/SA.yml From d79d7364652877bbd06be789c7ef7c6e45012ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 12 Oct 2025 22:02:20 +0200 Subject: [PATCH 5/5] Remove GITHUB_TOKEN from workflow secrets (#5) Removed GITHUB_TOKEN requirement from secrets in the workflow. --- .github/workflows/SA.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/SA.yml b/.github/workflows/SA.yml index 183cdb3..165c74c 100644 --- a/.github/workflows/SA.yml +++ b/.github/workflows/SA.yml @@ -11,9 +11,6 @@ on: type: string required: false default: 'analyse --no-progress --memory-limit=-1' - secrets: - GITHUB_TOKEN: - required: false jobs: sa: