diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18f8d2f0..d3ee98da 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,10 +4,8 @@ on: branches: - main pull_request: - branches: - - main jobs: - Build: + Test: strategy: matrix: os-php-versions: [ @@ -35,3 +33,21 @@ jobs: xdebug.max_nesting_level: 512 UPCLOUD_API_TEST_USER: ${{ secrets.UPCLOUD_API_TEST_USER }} UPCLOUD_API_TEST_PASSWORD: ${{ secrets.UPCLOUD_API_TEST_PASSWORD }} + + test-with-laravel: + name: Test install with laravel + strategy: + matrix: + laravel-version: + - 9 + - 10 + runs-on: ubuntu-latest + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + - uses: actions/checkout@v2 + - name: Test package can be required into laravel project + run: | + ./test/test-install-with-laravel.sh ${{ matrix.laravel-version }} diff --git a/.gitignore b/.gitignore index 50bcb840..d12a93dd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ git_push.sh /phpunit.xml /composer.lock .phpunit.result.cache +tmp/ diff --git a/test/test-install-with-laravel.sh b/test/test-install-with-laravel.sh new file mode 100755 index 00000000..11c7ae43 --- /dev/null +++ b/test/test-install-with-laravel.sh @@ -0,0 +1,13 @@ +#!/bin/sh -xe + +laravel_version=${1:-9} +dir="test-$laravel_version" + +mkdir -p tmp +cd tmp +rm -rf $dir + +composer create-project laravel/laravel $dir "^$laravel_version" +cd $dir +composer config repositories.dev path ../../ +composer require upcloudltd/upcloud-php-api @dev