Skip to content

Commit

Permalink
Merge pull request #403 from Astrotomic/laravel-11
Browse files Browse the repository at this point in the history
Laravel 11
  • Loading branch information
Gummibeer authored Apr 17, 2024
2 parents 1e8c46d + 88baff3 commit 7280902
Show file tree
Hide file tree
Showing 37 changed files with 630 additions and 650 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitbook.yaml export-ignore
/.php_cs export-ignore
/.styleci.yml export-ignore
/.phpunit.xml.dist export-ignore
/pint.json export-ignore
4 changes: 2 additions & 2 deletions .github/workflows/composer-normalize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4.1.2
uses: actions/checkout@v4

- name: Validate Composer configuration
run: composer validate --strict
Expand All @@ -22,6 +22,6 @@ jobs:
composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true
composer normalize --indent-style=space --indent-size=4 --no-check-lock --no-update-lock --no-interaction --ansi
- uses: stefanzweifel/git-auto-commit-action@v4.15.4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: normalize composer.json
4 changes: 2 additions & 2 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
compat-lookup: true
Expand All @@ -37,4 +37,4 @@ jobs:
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4 changes: 2 additions & 2 deletions .github/workflows/markdown-normalize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4.1.2
uses: actions/checkout@v4

- name: Prettify markdown
uses: creyD/prettier_action@v4.3
uses: creyD/prettier_action@v4
with:
prettier_options: --write **/*.md
41 changes: 22 additions & 19 deletions .github/workflows/run-tests.yml → .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
name: run-tests
name: phpunit

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
fail-fast: false
matrix:
php: [8.0, 8.1]
laravel: [8.*, 9.*, 10.*]
php: ['8.0', '8.1', '8.2', '8.3']
laravel: ['9.*', '10.*', '11.*']
dependency-version: [prefer-stable]
os: [ubuntu-latest]
include:
- laravel: '9.*'
phpunit: '9.*'
- laravel: '10.*'
phpunit: '10.*'
- laravel: '11.*'
phpunit: '10.*'
exclude:
- laravel: 10.*
php: 8.0
- php: '8.0'
laravel: '10.*'
- php: '8.0'
laravel: '11.*'
- php: '8.3'
laravel: '9.*'
- php: '8.1'
laravel: '11.*'

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/[email protected]

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-
dependencies-laravel-${{ matrix.laravel }}-php-
dependencies-laravel-
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -49,6 +51,7 @@ jobs:
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer require "phpunit/phpunit:${{ matrix.phpunit }}" --dev --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pint

on:
push:

jobs:
pint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- run: composer install --prefer-dist --no-interaction --no-suggest
- run: vendor/bin/pint --test
57 changes: 0 additions & 57 deletions .github/workflows/stale-issues.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/vendor/
/composer.lock
/coverage/
/.phpunit.result.cache
/.phpunit.cache
/build/
/coverage.clover
35 changes: 0 additions & 35 deletions .php_cs

This file was deleted.

3 changes: 0 additions & 3 deletions .styleci.yml

This file was deleted.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[![Offset Earth](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-green?style=for-the-badge)](https://plant.treeware.earth/Astrotomic/laravel-translatable)
[![Larabelles](https://img.shields.io/badge/Larabelles-%F0%9F%A6%84-lightpink?style=for-the-badge)](https://www.larabelles.com/)

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-translatable/run-tests?style=flat-square&logoColor=white&logo=github&label=Tests)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Arun-tests)
[![StyleCI](https://styleci.io/repos/192333549/shield)](https://styleci.io/repos/192333549)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-translatable/phpunit?style=flat-square&logoColor=white&logo=github&label=PHPunit)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Aphpunit)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-translatable/pint?style=flat-square&logoColor=white&logo=github&label=Pint)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Apint)
[![Codecov Coverage](https://img.shields.io/codecov/c/github/Astrotomic/laravel-translatable?logo=codecov&logoColor=white&label=Codecov&style=flat-square)](https://codecov.io/gh/Astrotomic/laravel-translatable)
[![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-translatable.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable)
[![GitBook](https://img.shields.io/badge/GitBook-Astrotomic-7e57c2.svg?style=flat-square)](https://docs.astrotomic.info/laravel-translatable)
Expand Down Expand Up @@ -97,7 +97,8 @@ If you discover any security related issues, please check [SECURITY](https://git
## Versions

| Package | Laravel | PHP |
|:--------------------|:------------------------------| :-------- |
| :------------------ | :---------------------------- | :-------- |
| **v11.13 - v11.13** | `9.* / 10.* / 11.*` | `^8.0` |
| **v11.12 - v11.12** | `8.* / 9.* / 10.*` | `^8.0` |
| **v11.10 - v11.11** | `8.* / 9.*` | `^8.0` |
| **v11.6 - v11.9** | `5.8.* / 6.* / 7.* / 8.*` | `>=7.2` |
Expand Down
21 changes: 12 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@
},
"require": {
"php": "^8.0",
"illuminate/contracts": "^8.0 || ^9.0 || ^10.0",
"illuminate/database": "^8.0 || ^9.0 || ^10.0",
"illuminate/support": "^8.0 || ^9.0 || ^10.0"
"illuminate/contracts": "^9.0 || ^10.0 || ^11.0",
"illuminate/database": "^9.0 || ^10.0 || ^11.0",
"illuminate/support": "^9.0 || ^10.0 || ^11.0"
},
"require-dev": {
"larastan/larastan": "^2.0",
"laravel/legacy-factories": "^1.0.4",
"laravel/pint": "^1.0",
"mockery/mockery": "^1.3.3",
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0",
"phpunit/phpunit": "^9.0"
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
"phpunit/phpunit": "^10.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -50,7 +52,7 @@
},
"autoload-dev": {
"psr-4": {
"Astrotomic\\Translatable\\Tests\\": "tests/"
"Tests\\": "tests/"
}
},
"config": {
Expand All @@ -64,8 +66,9 @@
}
},
"scripts": {
"csfix": "php-cs-fixer fix --using-cache=no",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html=build"
"fix": "@php vendor/bin/pint",
"phpstan": "@php vendor/bin/phpstan analyse",
"test": "@php vendor/bin/phpunit",
"test-coverage": "@php vendor/bin/phpunit --coverage-html=build"
}
}
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Version](http://img.shields.io/packagist/v/astrotomic/laravel-translatable.svg?label=Release&style=for-the-badge)](https://packagist.org/packages/astrotomic/laravel-translatable) [![MIT License](https://img.shields.io/github/license/Astrotomic/laravel-translatable.svg?label=License&color=blue&style=for-the-badge)](https://github.com/Astrotomic/laravel-translatable/blob/master/LICENSE) [![Offset Earth](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-green?style=for-the-badge)](https://plant.treeware.earth/Astrotomic/laravel-translatable)

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-translatable/run-tests?style=flat-square&logoColor=white&logo=github&label=Tests)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Arun-tests) [![StyleCI](https://styleci.io/repos/192333549/shield)](https://styleci.io/repos/192333549) [![Codecov Coverage](https://img.shields.io/codecov/c/github/Astrotomic/laravel-translatable?logo=codecov&logoColor=white&label=Codecov&style=flat-square)](https://codecov.io/gh/Astrotomic/laravel-translatable) [![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-translatable.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-translatable/phpunit?style=flat-square&logoColor=white&logo=github&label=PHPunit)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Aphpunit) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-translatable/pint?style=flat-square&logoColor=white&logo=github&label=Pint)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Apint) [![Codecov Coverage](https://img.shields.io/codecov/c/github/Astrotomic/laravel-translatable?logo=codecov&logoColor=white&label=Codecov&style=flat-square)](https://codecov.io/gh/Astrotomic/laravel-translatable) [![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-translatable.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable)

![Laravel Translatable](.gitbook/assets/socialcard.png)

Expand Down Expand Up @@ -74,7 +74,8 @@ echo $post->translate('fr')->title; // Mon premier post
## Versions

| Package | Laravel | PHP |
|:--------------------|:------------------------------| :-------- |
| :------------------ | :---------------------------- | :-------- |
| **v11.13 - v11.13** | `9.* / 10.* / 11.*` | `^8.0` |
| **v11.12 - v11.12** | `8.* / 9.* / 10.*` | `^8.0` |
| **v11.10 - v11.11** | `8.* / 9.*` | `^8.0` |
| **v11.6 - v11.9** | `5.8.* / 6.* / 7.* / 8.*` | `>=7.2` |
Expand Down
18 changes: 18 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
includes:
- vendor/larastan/larastan/extension.neon

parameters:

paths:
- src/

# Level 9 is the highest level
level: 6

# ignoreErrors:
# - '#PHPDoc tag @var#'
#
# excludePaths:
# - ./*/*/FileToBeExcluded.php
#
# checkMissingIterableValueType: false
21 changes: 10 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
backupStaticProperties="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
<directory suffix="Test.php">./tests/</directory>
<exclude>./tests/factories/</exclude>
<exclude>./tests/migrations/</exclude>
<exclude>./tests/models/</exclude>
<exclude>./tests/Eloquent/</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="false">
<source>
<include>
<directory suffix=".php">./src/Translatable/</directory>
</whitelist>
</filter>
</include>
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="testing"/>
Expand Down
Loading

0 comments on commit 7280902

Please sign in to comment.