diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index b64a1f6e..7e874ab1 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -12,7 +12,7 @@ jobs: name: Run code style check runs-on: "ubuntu-24.04" steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 @@ -42,7 +42,7 @@ jobs: - '8.4' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 @@ -70,3 +70,4 @@ jobs: functional-tests: name: "REST functional tests" uses: ./.github/workflows/integration-tests-callable.yaml + secrets: inherit diff --git a/.github/workflows/integration-tests-callable.yaml b/.github/workflows/integration-tests-callable.yaml index 3651fa38..ea5feb8a 100644 --- a/.github/workflows/integration-tests-callable.yaml +++ b/.github/workflows/integration-tests-callable.yaml @@ -7,7 +7,7 @@ env: PHP_INI_ENV_memory_limit: 512M COMPOSER_CACHE_DIR: ~/.composer/cache PROJECT_EDITION: oss - SETUP: "doc/docker/base-dev.yml:doc/docker/selenium.yml" + SETUP: "doc/docker/base-dev.yml" WEB_HOST: web jobs: @@ -22,27 +22,43 @@ jobs: - '8.4' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set project version run: | version=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json) echo "version=$version" >> $GITHUB_ENV + - name: Generate token + id: generate_token + uses: actions/create-github-app-token@v3 + with: + client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + private-key: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + owner: ${{ github.repository_owner }} + - name: Setup PHP Action uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: none + github-token: ${{ steps.generate_token.outputs.token }} - name: Cache dependencies - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: ${{ env.COMPOSER_CACHE_DIR }} key: "${{ env.PROJECT_EDITION }}-${{ env.version }}-${{ github.sha }}" restore-keys: | ${{ env.PROJECT_EDITION }}-${{ env.version }} + - name: Add composer key for GitHub App + if: ${{ steps.generate_token.outputs.token != '' }} + run: | + composer config github-oauth.github.com $GITHUB_TOKEN + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + - 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 @@ -54,7 +70,20 @@ jobs: 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 + - name: Configure composer inside vendor/ibexa/rest + run: | + cd "$HOME/build/project" + docker compose --env-file=.env exec -T --user www-data app sh -c " + cd vendor/ibexa/rest && + curl -fsSLO https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/_common/configure_composer_audit_ignores.sh && + bash configure_composer_audit_ignores.sh && + composer update + " + + - name: Run tests inside vendor/ibexa/rest against configured instance 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" + docker compose --env-file=.env exec -T --user www-data -e EZP_TEST_REST_HOST=$WEB_HOST app sh -c " + cd vendor/ibexa/rest && + composer test-functional + "