diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8746c8..75e4f15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,37 +3,76 @@ on: pull_request: push: jobs: - tests: + tests-80: runs-on: ubuntu-latest strategy: fail-fast: true matrix: - php: [8.0, 8.1] - stability: [prefer-lowest, prefer-stable] - name: PHP ${{ matrix.php }} - ${{ matrix.stability }} + php: [ 8.0 ] + laravel: [ 9.0 ] + name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} steps: - name: Checkout code uses: actions/checkout@v3 - - name: Get Composer Cache Directory + - name: Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - name: Cache dependencies + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}- + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + extensions: dom, curl, libxml, mbstring, zip, pcntl, gd, soap + coverage: none + + - name: Install dependencies + run: composer require "illuminate/auth:^${{ matrix.laravel }}" "illuminate/config:^${{ matrix.laravel }}" "illuminate/database:^${{ matrix.laravel }}" "illuminate/support:^${{ matrix.laravel }}" "illuminate/translation:^${{ matrix.laravel }}" --prefer-stable --prefer-dist --no-interaction + + - name: Execute tests + run: vendor/bin/phpunit --verbose + + tests-81: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [ 8.1 ] + laravel: [ 9.0, 10.0 ] + name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}- - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} + tools: composer:v2 extensions: dom, curl, libxml, mbstring, zip, pcntl, gd, soap coverage: none - name: Install dependencies - run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest + run: composer require "illuminate/auth:^${{ matrix.laravel }}" "illuminate/config:^${{ matrix.laravel }}" "illuminate/database:^${{ matrix.laravel }}" "illuminate/support:^${{ matrix.laravel }}" "illuminate/translation:^${{ matrix.laravel }}" --prefer-stable --prefer-dist --no-interaction - name: Execute tests run: vendor/bin/phpunit --verbose @@ -52,17 +91,19 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-composer- - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.1' + tools: composer:v2 + extensions: dom, curl, libxml, mbstring, zip, pcntl, gd, soap coverage: none - name: Install dependencies - run: composer install --no-suggest --prefer-dist -n -o + run: composer install --no-suggest --prefer-dist --no-interaction --optimize-autoloader - name: Run style check run: vendor/bin/phpcs diff --git a/README.md b/README.md index fde88a9..7f695c1 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This means that the method for storage must be efficient, unlike other packages ### Laravel -You are reading the documentation for 9.x. +You are reading the documentation for 10.x and 9.x. * If you're using Laravel 6, 7 or 8 please see the docs for [3.x](https://github.com/sourcetoad/Logger/releases/tag/v3.0.1). * If you're using Laravel 5 or below please see docs for [1.x](https://github.com/sourcetoad/Logger/releases/tag/v1.3.0) diff --git a/composer.json b/composer.json index a4c1b63..dbed7ec 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,12 @@ "prefer-stable": true, "require": { "ext-json": "*", - "php": ">=8.0.2", - "illuminate/auth": "^9.0", - "illuminate/config": "^9.0", - "illuminate/database": "^9.0", - "illuminate/support": "^9.0", - "illuminate/translation": "^9.0" + "php": "^8.0|^8.1", + "illuminate/auth": "^9.0|^10.0", + "illuminate/config": "^9.0|^10.0", + "illuminate/database": "^9.0|^10.0", + "illuminate/support": "^9.0|^10.0", + "illuminate/translation": "^9.0|^10.0" }, "autoload": { "psr-4": { @@ -44,7 +44,7 @@ } }, "require-dev": { - "squizlabs/php_codesniffer": "^3.5", + "squizlabs/php_codesniffer": "^3.7", "phpunit/phpunit": "^9.5" } } diff --git a/docker/Dockerfile b/docker/Dockerfile index 8e58826..a1b9297 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0-fpm +FROM php:8.1-fpm RUN apt-get update && apt-get install -y \ git \