diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index a4c9103f5..1b1221e10 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -38,6 +38,7 @@ jobs: php-versions: ${{ steps.settings.outputs.php-versions }} dependencies: ${{ steps.settings.outputs.dependencies }} laravel-versions: ${{ steps.settings.outputs.laravel-versions }} + optional-packages: ${{ steps.settings.outputs.optional-packages }} steps: - name: Checkout uses: actions/checkout@v4 @@ -65,6 +66,9 @@ jobs: # Laravel echo "laravel-versions=$(jq '.require."laravel/framework" // "null" | split("|") | sort' -c composer.json)" >> $GITHUB_OUTPUT + # Optional packages + echo "optional-packages=$(jq '([((."extra"."lara-asp"."ci"."optional-packages" // ["null"]) | flatten | unique | sort | join(","))] + ["null"]) | unique' -r -c composer.json)" >> $GITHUB_OUTPUT + run: # Only 28 characters are visible on UI :( name: >- @@ -72,6 +76,7 @@ jobs: ${{ matrix.laravel != 'null' && format('L{0}', matrix.laravel) || '' }} ${{ matrix.dependencies == 'locked' && '๐Ÿ”’' || (matrix.dependencies == 'highest' && '๐Ÿกน' || '๐Ÿกป') }} ${{ startsWith(matrix.os, 'windows') && '๐Ÿ††' || (startsWith(matrix.os, 'macos') && '๐Ÿ…ผ' || '๐Ÿ†„') }} + ${{ matrix.optional != 'null' && '๐Ÿช“' || '' }} runs-on: ${{ matrix.os }} needs: @@ -82,6 +87,7 @@ jobs: matrix: php: ${{ fromJson(needs.settings.outputs.php-versions) }} laravel: ${{ fromJson(needs.settings.outputs.laravel-versions) }} + optional: ${{ fromJson(needs.settings.outputs.optional-packages) }} dependencies: ${{ fromJson(needs.settings.outputs.dependencies) }} os: ${{ fromJson(inputs.runs-on) }} exclude: @@ -131,6 +137,19 @@ jobs: composer require --no-interaction --no-progress --ansi --no-update "laravel/framework:${{ matrix.laravel }}" composer remove --no-interaction --no-progress --ansi --no-update --dev larastan/larastan + - name: Remove optional packages + if: ${{ matrix.optional != 'null' }} + shell: bash + working-directory: ${{ env.WORKING_DIRECTORY }} + run: | + PACKAGES=$(echo '"${{ matrix.optional }}"' | jq 'split(",")' | jq -c -r '.[]') + + while read -r PKG + do + composer remove --no-interaction --no-progress --ansi --no-update "${PKG}" + composer remove --no-interaction --no-progress --ansi --no-update --dev "${PKG}" + done <<< "${PACKAGES}" + - name: Install dependencies uses: ramsey/composer-install@v2 with: diff --git a/packages/graphql/composer.json b/packages/graphql/composer.json index 4c8e8b410..4bc95458f 100644 --- a/packages/graphql/composer.json +++ b/packages/graphql/composer.json @@ -64,11 +64,9 @@ "ext-fileinfo" ] }, - "optional-packages": { - "lastdragon-ru/lara-asp-graphql": [ - "laravel/scout" - ] - } + "optional-packages": [ + "laravel/scout" + ] } } },