Skip to content

Commit 0e96819

Browse files
authored
Laravel 12 (#86)
* laravel 12 * Fix styling * phpstan * baseline * remove versions * test bench * min stability * missing stability * phpunit.xml update * remove ci option --------- Co-authored-by: swilla <[email protected]>
1 parent f81c3c7 commit 0e96819

18 files changed

+279
-110
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: dependabot-auto-merge
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
15+
- name: Dependabot metadata
16+
id: metadata
17+
uses: dependabot/[email protected]
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
21+
- name: Auto-merge Dependabot PRs for semver-minor updates
22+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
23+
run: gh pr merge --auto --merge "$PR_URL"
24+
env:
25+
PR_URL: ${{github.event.pull_request.html_url}}
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
28+
- name: Auto-merge Dependabot PRs for semver-patch updates
29+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
30+
run: gh pr merge --auto --merge "$PR_URL"
31+
env:
32+
PR_URL: ${{github.event.pull_request.html_url}}
33+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Fix PHP code style issues
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
php-code-styling:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }}
21+
22+
- name: Fix PHP code style issues
23+
uses: aglipanci/[email protected]
24+
25+
- name: Commit changes
26+
uses: stefanzweifel/git-auto-commit-action@v5
27+
with:
28+
commit_message: Fix styling

.github/workflows/phpstan.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,24 @@ on:
55
paths:
66
- '**.php'
77
- 'phpstan.neon.dist'
8-
pull_request:
9-
paths:
10-
- '**.php'
11-
- 'phpstan.neon.dist'
12-
8+
- '.github/workflows/phpstan.yml'
139

1410
jobs:
1511
phpstan:
1612
name: phpstan
1713
runs-on: ubuntu-latest
14+
timeout-minutes: 5
1815
steps:
1916
- uses: actions/checkout@v4
2017

2118
- name: Setup PHP
2219
uses: shivammathur/setup-php@v2
2320
with:
24-
php-version: '8.0'
21+
php-version: '8.3'
2522
coverage: none
2623

2724
- name: Install composer dependencies
28-
uses: ramsey/composer-install@v1
25+
uses: ramsey/composer-install@v3
2926

3027
- name: Run PHPStan
3128
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/pint.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/run-tests.yml

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,29 @@
11
name: Run Tests - Current
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
paths:
6+
- '**.php'
7+
- '.github/workflows/run-tests.yml'
8+
- 'phpunit.xml.dist'
9+
- 'composer.json'
10+
- 'composer.lock'
611

712
jobs:
813
test:
9-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 5
1016

1117
strategy:
12-
fail-fast: false
18+
fail-fast: true
1319
matrix:
14-
php: [8.3, 8.2, 8.1, 8.0, 7.4]
15-
laravel: ['8.*', '9.*', '10.*', '11.*']
16-
dependency-version: [prefer-lowest, prefer-stable]
17-
exclude:
18-
- laravel: 10.*
19-
php: 8.0
20-
- laravel: 10.*
21-
php: 7.4
22-
- laravel: 9.*
23-
php: 7.4
24-
- laravel: 8.*
25-
php: 8.1
26-
- laravel: 8.*
27-
php: 8.2
28-
- laravel: 8.*
29-
php: 8.3
30-
- laravel: 11.*
31-
php: 8.1
32-
- laravel: 11.*
33-
php: 8.0
34-
- laravel: 11.*
35-
php: 7.4
20+
os: [ubuntu-latest]
21+
php: [8.4, 8.3, 8.2]
22+
laravel: ['11.*', '12.*']
23+
stability: [prefer-lowest, prefer-stable]
3624
include:
37-
- laravel: 10.*
38-
testbench: 8.*
39-
- laravel: 9.*
40-
testbench: 7.*
41-
- laravel: 8.*
42-
testbench: 6.*
25+
- laravel: 12.*
26+
testbench: 10.*
4327
- laravel: 11.*
4428
testbench: 9.*
4529

@@ -59,14 +43,24 @@ jobs:
5943
uses: shivammathur/setup-php@v2
6044
with:
6145
php-version: ${{ matrix.php }}
62-
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
63-
coverage: pcov
46+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
47+
coverage: none
48+
49+
- name: Setup problem matchers
50+
run: |
51+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
52+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
6453
6554
- name: Install dependencies
6655
run: |
67-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "symfony/console:>=4.3.4" "mockery/mockery:^1.3.2" --no-interaction --no-update
68-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
69-
cp .env.example .env
56+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
57+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
58+
59+
- name: Copy .env.example
60+
run: cp .env.example .env
61+
62+
- name: List Installed Dependencies
63+
run: composer show -D
7064

7165
- name: Execute tests
72-
run: vendor/bin/phpunit
66+
run: vendor/bin/pest
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: main
20+
21+
- name: Update Changelog
22+
uses: stefanzweifel/changelog-updater-action@v1
23+
with:
24+
latest-version: ${{ github.event.release.name }}
25+
release-notes: ${{ github.event.release.body }}
26+
27+
- name: Commit updated CHANGELOG
28+
uses: stefanzweifel/git-auto-commit-action@v5
29+
with:
30+
branch: main
31+
commit_message: Update CHANGELOG
32+
file_pattern: CHANGELOG.md

composer.json

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,23 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3",
20-
"guzzlehttp/guzzle": "~6.0 || ~7.0",
21-
"illuminate/support": "5.7.* || 5.8.* ||^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
22-
"symfony/dotenv": "^4.2 || ^5.1 || ^7.0"
19+
"php": "^8.2 || ^8.3 || ^8.4",
20+
"guzzlehttp/guzzle": "~7.0",
21+
"illuminate/support": "^10.0 || ^11.0 || ^12.0",
22+
"symfony/dotenv": "^6.0 || ^7.0"
2323
},
2424
"require-dev": {
25-
"mockery/mockery": "^1.4",
26-
"orchestra/testbench": "^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
27-
"phpstan/extension-installer": "^1.1",
28-
"phpstan/phpstan-deprecation-rules": "^1.0",
29-
"phpstan/phpstan-phpunit": "^1.0",
30-
"phpunit/phpunit": "^8.4 || ^9.3.3 || ^10.0"
25+
"larastan/larastan": "^2.9||^3.0",
26+
"laravel/pint": "^1.14",
27+
"nunomaduro/collision": "^8.1.1||^7.10.0",
28+
"orchestra/testbench": "^10.0.0||^9.0.0||^8.22.0",
29+
"pestphp/pest": "^3.0||^2.34",
30+
"pestphp/pest-plugin-arch": "^3.0||^2.7",
31+
"pestphp/pest-plugin-laravel": "^3.0||^2.3",
32+
"phpstan/extension-installer": "^1.3||^2.0",
33+
"phpstan/phpstan-deprecation-rules": "^1.1||^2.0",
34+
"phpstan/phpstan-phpunit": "^1.3||^2.0",
35+
"spatie/laravel-ray": "^1.35"
3136
},
3237
"autoload": {
3338
"psr-4": {
@@ -36,7 +41,8 @@
3641
},
3742
"autoload-dev": {
3843
"psr-4": {
39-
"Tapp\\Airtable\\Tests\\": "tests"
44+
"Tapp\\Airtable\\Tests\\": "tests",
45+
"Workbench\\App\\": "workbench/app/"
4046
}
4147
},
4248
"scripts": {
@@ -60,5 +66,7 @@
6066
"Airtable": "Tapp\\Airtable\\Facades\\AirtableFacade"
6167
}
6268
}
63-
}
69+
},
70+
"minimum-stability": "dev",
71+
"prefer-stable": true
6472
}

phpstan-baseline.neon

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Called ''env'' outside of the config directory which returns null when the config is cached, use ''config''\.$#'
5+
identifier: larastan.noEnvCallsOutsideOfConfig
6+
count: 5
7+
path: config/config.php
8+
9+
-
10+
message: '#^Consider using bind method instead or pass a closure\.$#'
11+
identifier: larastan.octaneCompatibility
12+
count: 2
13+
path: src/AirtableServiceProvider.php

phpstan.neon.dist

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ parameters:
77
- src
88
- config
99
tmpDir: build/phpstan
10-
excludePaths:
11-
- ./vendor
12-
checkMissingIterableValueType: true
10+
checkOctaneCompatibility: true
11+
checkModelProperties: true

phpunit.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
>
7+
<testsuites>
8+
<testsuite name="Test Suite">
9+
<directory suffix="Test.php">./tests</directory>
10+
</testsuite>
11+
</testsuites>
12+
<source>
13+
<include>
14+
<directory suffix=".php">./app</directory>
15+
<directory suffix=".php">./src</directory>
16+
</include>
17+
</source>
18+
</phpunit>

0 commit comments

Comments
 (0)