diff --git a/.github/workflows/pest.yml b/.github/workflows/pest.yml index 8cfc5e8..28aef02 100644 --- a/.github/workflows/pest.yml +++ b/.github/workflows/pest.yml @@ -1,80 +1,82 @@ name: Tests on: - push: - branches: - - master - pull_request: + push: + branches: + - master + pull_request: jobs: - test: - name: Pest - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - DB ${{ matrix.db }} ${{ matrix.dependency-version }} + test: + name: Pest - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - DB ${{ matrix.db }} ${{ matrix.dependency-version }} - runs-on: ubuntu-latest + runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: [ 8.3, 8.2, 8.1 ] - laravel: [ 11.*, 10.* ] - db: [ 'mysql:8.0', 'mysql:5.7', 'mariadb:10.11', 'postgis/postgis:16-3.4', 'postgis/postgis:15-3.4', 'postgis/postgis:14-3.4', 'postgis/postgis:13-3.4', 'postgis/postgis:12-3.4' ] - dependency-version: [ prefer-stable ] - include: - - laravel: 10.* - testbench: ^8.0 - - laravel: 11.* - testbench: ^9.0 - exclude: - - laravel: 11.* - php: 8.1 + strategy: + fail-fast: false + matrix: + php: [8.3, 8.2, 8.1] + laravel: ['10.*', '11.*', '12.*'] + db: ['mysql:8.0', 'mysql:5.7', 'mariadb:10.11', 'postgis/postgis:16-3.4', 'postgis/postgis:15-3.4', 'postgis/postgis:14-3.4', 'postgis/postgis:13-3.4', 'postgis/postgis:12-3.4'] + dependency-version: [prefer-stable] + include: + - laravel: 10.* + testbench: ^8.0 + - laravel: 11.* + testbench: ^9.0 + - laravel: 12.* + testbench: ^10.0 + exclude: + - laravel: 11.* + php: 8.1 + - laravel: 12.* + php: 8.1 - services: - db: - image: ${{ matrix.db }} - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: laravel_eloquent_spatial_test - POSTGRES_DB: laravel_eloquent_spatial_test - POSTGRES_USER: root - POSTGRES_HOST_AUTH_METHOD: trust - ports: - - ${{ contains(matrix.db, 'postgis') && '5432' || '3306' }} - options: >- - ${{ (contains(matrix.db, 'postgis') && '--health-cmd="pg_isready"') || '--health-cmd="mysqladmin ping"' }} - --health-interval=10s --health-timeout=5s --health-retries=3 + services: + db: + image: ${{ matrix.db }} + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: laravel_eloquent_spatial_test + POSTGRES_DB: laravel_eloquent_spatial_test + POSTGRES_USER: root + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - ${{ contains(matrix.db, 'postgis') && '5432' || '3306' }} + options: ${{ (contains(matrix.db, 'postgis') && '--health-cmd="pg_isready"') || '--health-cmd="mysqladmin ping"' }} --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - name: Checkout code - uses: actions/checkout@v2 + steps: + - name: Checkout code + uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction - - name: Set DB_CONNECTION env variable (PostGIS) - if: contains(matrix.db, 'postgis') - run: | - echo "DB_CONNECTION=pgsql" >> "$GITHUB_ENV" + - name: Set DB_CONNECTION env variable (PostGIS) + if: "contains(matrix.db, 'postgis')" + run: | + echo "DB_CONNECTION=pgsql" >> "$GITHUB_ENV" - - name: Set DB_CONNECTION env variable (MariaDB & Laravel 11) - if: contains(matrix.laravel, '11') && contains(matrix.db, 'mariadb') - run: | - echo "DB_CONNECTION=mariadb" >> "$GITHUB_ENV" + - name: Set DB_CONNECTION env variable (MariaDB & Laravel 11) + if: "contains(matrix.laravel, '11') && contains(matrix.db, 'mariadb')" + run: | + echo "DB_CONNECTION=mariadb" >> "$GITHUB_ENV" - - name: Set DB_COLLATION env variable (Mysql 5.7 & Laravel 11) - if: contains(matrix.laravel, '11') && contains(matrix.db, 'mysql:5.7') - run: | - echo "DB_COLLATION=utf8mb4_unicode_ci" >> "$GITHUB_ENV" + - name: Set DB_COLLATION env variable (Mysql 5.7 & Laravel 11) + if: "contains(matrix.laravel, '11') && contains(matrix.db, 'mysql:5.7')" + run: | + echo "DB_COLLATION=utf8mb4_unicode_ci" >> "$GITHUB_ENV" - - name: Execute tests - env: - DB_PORT: ${{ job.services.db.ports[contains(matrix.db, 'postgis') && '5432' || '3306'] }} - DB_CONNECTION: ${{ env.DB_CONNECTION || 'mysql' }} - run: vendor/bin/pest + - name: Execute tests + env: + DB_PORT: ${{ job.services.db.ports[contains(matrix.db, 'postgis') && '5432' || '3306'] }} + DB_CONNECTION: ${{ env.DB_CONNECTION || 'mysql' }} + run: vendor/bin/pest diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 4818f76..55a02d6 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -1,34 +1,34 @@ name: Static code analysis on: - push: - branches: - - master - pull_request: + push: + branches: + - master + pull_request: jobs: - phpstan: - name: PHPStan + phpstan: + name: PHPStan - runs-on: ubuntu-latest + runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: [ 8.3, 8.2 ] + strategy: + fail-fast: false + matrix: + php: [8.3, 8.2] - steps: - - name: Checkout code - uses: actions/checkout@v2 + steps: + - name: Checkout code + uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none - - name: Install dependencies - run: composer install --prefer-dist --no-interaction + - name: Install dependencies + run: composer install --prefer-dist --no-interaction - - name: Run PHPStan - run: ./vendor/bin/phpstan analyse --memory-limit=2G --error-format=github + - name: Run PHPStan + run: ./vendor/bin/phpstan analyse --memory-limit=2G --error-format=github diff --git a/composer.json b/composer.json index a521c35..4010584 100644 --- a/composer.json +++ b/composer.json @@ -13,16 +13,16 @@ "php": "^8.1", "ext-json": "*", "ext-pdo": "*", - "laravel/framework": "^10.0|^11.0", + "laravel/framework": "^10.0|^11.0|^12.0", "phayes/geophp": "^1.2" }, "require-dev": { - "doctrine/dbal": "^3.5.3", + "doctrine/dbal": "^3.5.3|^4.2", "larastan/larastan": "^1.0|^2.4", "laravel/pint": "^1.14", - "orchestra/testbench": "^8.0|^9.0", - "pestphp/pest": "^2.0", - "pestphp/pest-plugin-laravel": "^2.0" + "orchestra/testbench": "^8.0|^9.0|^10.0", + "pestphp/pest": "^2.0|^3.7", + "pestphp/pest-plugin-laravel": "^2.0|^3.1" }, "autoload": { "psr-4": {