Skip to content

Commit b562eb4

Browse files
authored
Laravel 10 Support (#38)
* SIP-371: update: package version bump * SIP-371: update: revert to using version * SIP-371: update: docker use php-8.1 * SIP-371: update: restore phpunit v9 * SIP-371: update: allow php v8.0 and v8.1 * SIP-371: update: update read me * SIP-371: update: add laravel 10 build support * SIP-371: update: change php version * SIP-371: update: revert install dependency logic * SIP-371: update: workflow install dependencies * SIP-371: update: align yaml file * SIP-371: update: align yaml file * SIP-371: update: revert to last point jobs worked * SIP-371: update: dependency install * SIP-371: update: GitHub actions fix * SIP-371: update: add stability tests for php * SIP-371: update: revert stability tests * SIP-371: update: fix code style on composer json
1 parent 905fb0e commit b562eb4

File tree

4 files changed

+61
-20
lines changed

4 files changed

+61
-20
lines changed

.github/workflows/main.yml

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,76 @@ on:
33
pull_request:
44
push:
55
jobs:
6-
tests:
6+
tests-80:
77
runs-on: ubuntu-latest
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [8.0, 8.1]
12-
stability: [prefer-lowest, prefer-stable]
13-
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
11+
php: [ 8.0 ]
12+
laravel: [ 9.0 ]
13+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
1414
steps:
1515
- name: Checkout code
1616
uses: actions/checkout@v3
1717

18-
- name: Get Composer Cache Directory
18+
- name: Get composer cache directory
1919
id: composer-cache
2020
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
2121

22-
- uses: actions/cache@v3
22+
- name: Cache dependencies
23+
uses: actions/cache@v3
2324
with:
2425
path: ${{ steps.composer-cache.outputs.dir }}
25-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
26-
restore-keys: ${{ runner.os }}-composer-
26+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}
27+
restore-keys: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php }}
33+
tools: composer:v2
34+
extensions: dom, curl, libxml, mbstring, zip, pcntl, gd, soap
35+
coverage: none
36+
37+
- name: Install dependencies
38+
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
39+
40+
- name: Execute tests
41+
run: vendor/bin/phpunit --verbose
42+
43+
tests-81:
44+
runs-on: ubuntu-latest
45+
strategy:
46+
fail-fast: true
47+
matrix:
48+
php: [ 8.1 ]
49+
laravel: [ 9.0, 10.0 ]
50+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
51+
steps:
52+
- name: Checkout code
53+
uses: actions/checkout@v3
54+
55+
- name: Get composer cache directory
56+
id: composer-cache
57+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
58+
59+
- name: Cache dependencies
60+
uses: actions/cache@v3
61+
with:
62+
path: ${{ steps.composer-cache.outputs.dir }}
63+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}
64+
restore-keys: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-
2765

2866
- name: Setup PHP
2967
uses: shivammathur/setup-php@v2
3068
with:
3169
php-version: ${{ matrix.php }}
70+
tools: composer:v2
3271
extensions: dom, curl, libxml, mbstring, zip, pcntl, gd, soap
3372
coverage: none
3473

3574
- name: Install dependencies
36-
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
75+
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
3776

3877
- name: Execute tests
3978
run: vendor/bin/phpunit --verbose
@@ -52,17 +91,19 @@ jobs:
5291
- uses: actions/cache@v3
5392
with:
5493
path: ${{ steps.composer-cache.outputs.dir }}
55-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
94+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
5695
restore-keys: ${{ runner.os }}-composer-
5796

5897
- name: Setup PHP
5998
uses: shivammathur/setup-php@v2
6099
with:
61100
php-version: '8.1'
101+
tools: composer:v2
102+
extensions: dom, curl, libxml, mbstring, zip, pcntl, gd, soap
62103
coverage: none
63104

64105
- name: Install dependencies
65-
run: composer install --no-suggest --prefer-dist -n -o
106+
run: composer install --no-suggest --prefer-dist --no-interaction --optimize-autoloader
66107

67108
- name: Run style check
68109
run: vendor/bin/phpcs

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This means that the method for storage must be efficient, unlike other packages
2323

2424
### Laravel
2525

26-
You are reading the documentation for 9.x.
26+
You are reading the documentation for 10.x and 9.x.
2727

2828
* 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).
2929
* If you're using Laravel 5 or below please see docs for [1.x](https://github.com/sourcetoad/Logger/releases/tag/v1.3.0)

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"prefer-stable": true,
1717
"require": {
1818
"ext-json": "*",
19-
"php": ">=8.0.2",
20-
"illuminate/auth": "^9.0",
21-
"illuminate/config": "^9.0",
22-
"illuminate/database": "^9.0",
23-
"illuminate/support": "^9.0",
24-
"illuminate/translation": "^9.0"
19+
"php": "^8.0|^8.1",
20+
"illuminate/auth": "^9.0|^10.0",
21+
"illuminate/config": "^9.0|^10.0",
22+
"illuminate/database": "^9.0|^10.0",
23+
"illuminate/support": "^9.0|^10.0",
24+
"illuminate/translation": "^9.0|^10.0"
2525
},
2626
"autoload": {
2727
"psr-4": {
@@ -44,7 +44,7 @@
4444
}
4545
},
4646
"require-dev": {
47-
"squizlabs/php_codesniffer": "^3.5",
47+
"squizlabs/php_codesniffer": "^3.7",
4848
"phpunit/phpunit": "^9.5"
4949
}
5050
}

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.0-fpm
1+
FROM php:8.1-fpm
22

33
RUN apt-get update && apt-get install -y \
44
git \

0 commit comments

Comments
 (0)