From 3239965af68171d7814a9fde6fde1817ac8b1e67 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 21 May 2026 14:01:21 +0200 Subject: [PATCH 1/3] [GHA][Backend CI] Switched to Ibexa Composer Install GHA --- .github/workflows/backend-ci.yaml | 58 +++++++++++++------------------ 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 19a4afd1..b7e1f814 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -12,22 +12,17 @@ jobs: name: Run code style check runs-on: "ubuntu-24.04" steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6 - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - coverage: none - extensions: 'pdo_sqlite, gd' - tools: cs2pr + - uses: ibexa/gh-workflows/actions/composer-install@main + with: + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} - - uses: ramsey/composer-install@v3 - with: - dependency-versions: highest - - - name: Run code style check - run: composer run-script check-cs -- --format=checkstyle | cs2pr + - name: Run code style check + run: composer run-script check-cs -- --format=checkstyle | cs2pr tests: name: Unit & integration tests @@ -43,30 +38,25 @@ jobs: - '8.4' steps: - - uses: actions/checkout@v6 - - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - extensions: pdo_sqlite, gd - tools: cs2pr + - uses: actions/checkout@v6 - - uses: ramsey/composer-install@v3 - with: - dependency-versions: highest + - uses: ibexa/gh-workflows/actions/composer-install@main + with: + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} - - name: Run PHPStan analysis - run: composer run-script phpstan + - name: Run PHPStan analysis + run: composer run-script phpstan - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Run unit test suite - run: composer test - - name: Run integration test suite - run: composer test-integration + - name: Run unit test suite + run: composer test + - name: Run integration test suite + run: composer test-integration functional-tests: name: "REST functional tests" From 76dae3d6a6d90fe4652f3f3420417c6a0f82e41a Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 21 May 2026 14:01:54 +0200 Subject: [PATCH 2/3] [GHA][REST Functional] Added Composer Audit Ignore GHA --- .../workflows/integration-tests-callable.yaml | 85 ++++++++++--------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/.github/workflows/integration-tests-callable.yaml b/.github/workflows/integration-tests-callable.yaml index c43c1c9c..4372dc0a 100644 --- a/.github/workflows/integration-tests-callable.yaml +++ b/.github/workflows/integration-tests-callable.yaml @@ -18,44 +18,49 @@ jobs: strategy: matrix: include: - - php: '7.4' - node: 18 - - php: '8.3' - node: 22 + - php: '7.4' + node: 18 + - php: '8.3' + node: 22 steps: - - uses: actions/checkout@v6 - - - name: Set project version - run: | - version=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json) - echo "version=$version" >> $GITHUB_ENV - - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: ${{ env.PROJECT_EDITION }}-${{ env.version }}-${{ github.sha }} - restore-keys: | - ${{ env.PROJECT_EDITION }}-${{ env.version }} - - - name: Set up whole project using the tested dependency - run: | - curl -L "https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/${{ env.version }}/prepare_project_edition.sh" > prepare_project_edition.sh - chmod +x prepare_project_edition.sh - ./prepare_project_edition.sh ${{ env.PROJECT_EDITION }} ${{ env.version }} ${{ env.SETUP }} "ghcr.io/ibexa/docker/php:${{ matrix.php }}-node${{ matrix.node }}" - - - name: Run setup command - run: | - cd "$HOME/build/project" - docker compose --env-file=.env exec -T --user www-data app sh -c "APP_ENV=behat php bin/console ibexa:behat:create-language 'pol-PL' 'Polish (polski)'" - - - name: Run tests - run: | - cd "$HOME/build/project" - docker compose --env-file=.env exec -T --user www-data app sh -c "cd vendor/ibexa/rest && composer update && composer test-functional" + - uses: actions/checkout@v6 + + - name: Set project version + run: | + version=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json) + echo "version=$version" >> $GITHUB_ENV + + - name: Setup PHP Action + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Ignore unsolvable advisories for PHP versions past EOL + uses: ibexa/gh-workflows/actions/composer-audit-ignore@main + with: + php-version: '${{ matrix.php }}' + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ env.COMPOSER_CACHE_DIR }} + key: ${{ env.PROJECT_EDITION }}-${{ env.version }}-${{ github.sha }} + restore-keys: | + ${{ env.PROJECT_EDITION }}-${{ env.version }} + + - name: Set up whole project using the tested dependency + run: | + curl -L "https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/${{ env.version }}/prepare_project_edition.sh" > prepare_project_edition.sh + chmod +x prepare_project_edition.sh + ./prepare_project_edition.sh ${{ env.PROJECT_EDITION }} ${{ env.version }} ${{ env.SETUP }} "ghcr.io/ibexa/docker/php:${{ matrix.php }}-node${{ matrix.node }}" + + - name: Run setup command + run: | + cd "$HOME/build/project" + docker compose --env-file=.env exec -T --user www-data app sh -c "APP_ENV=behat php bin/console ibexa:behat:create-language 'pol-PL' 'Polish (polski)'" + + - name: Run tests + run: | + cd "$HOME/build/project" + docker compose --env-file=.env exec -T --user www-data app sh -c "cd vendor/ibexa/rest && composer update && composer test-functional" From 6ee170e370cc94e55ac1afc7d92112b3137e8222 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 21 May 2026 14:09:26 +0200 Subject: [PATCH 3/3] [GHA][Backend CI] Explicitly configured PHP version for CS job --- .github/workflows/backend-ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index b7e1f814..c9d0b5f8 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -11,6 +11,10 @@ jobs: cs-fix: name: Run code style check runs-on: "ubuntu-24.04" + strategy: + matrix: + php: + - '8.1' steps: - uses: actions/checkout@v6