-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to PHP 8.1 as default version (#33)
- Loading branch information
1 parent
018ae65
commit df4cd11
Showing
11 changed files
with
119 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
/phpunit.xml export-ignore | ||
/rector.73.php export-ignore | ||
/rector.74.php export-ignore | ||
/rector.80.php export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Tests (8.x) | ||
on: | ||
repository_dispatch: | ||
types: | ||
- trigger-8x-tests | ||
|
||
jobs: | ||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
version: ['8.0'] | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.version }} | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: php-${{ matrix.version }} | ||
submodules: true | ||
- name: Install Dependencies | ||
run: composer install | ||
- name: Run tests | ||
run: composer phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,53 @@ | ||
name: Transpile to 7.x | ||
name: Transpile to older versions | ||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
transpile_73: | ||
name: Transpile to PHP 7.3 | ||
transpile: | ||
name: Transpile to older versions of PHP | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
version: ['7.3', '7.4', '8.0'] | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
php-version: 8.1 | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
- name: Install Dependencies | ||
run: composer install | ||
- name: Transpile to 7.3 | ||
run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.73.php src | ||
- name: Update composer.json version | ||
run: 'sed -i -e ''s/"php": "\^8.0"/"php": "\^7.3"/'' composer.json' | ||
- name: Update README | ||
run: sed -i '1s/^/# This branch is auto generated\n/' README.md | ||
- name: Commit PHP 7.3 version | ||
uses: actions-x/commit@v2 | ||
with: | ||
files: . | ||
branch: php-7.3 | ||
name: GitHub Actions | ||
email: noreply@github.com | ||
message: Transpiled to PHP 7.3 | ||
force: true | ||
transpile_74: | ||
name: Transpile to PHP 7.4 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
- name: Install Dependencies | ||
run: composer install | ||
- name: Transpile to 7.4 | ||
run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.74.php src | ||
- name: Transpile to ${{ matrix.version }} | ||
run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.$(echo ${{ matrix.version }} | sed -e 's/\.//').php src | ||
- name: Update composer.json version | ||
run: 'sed -i -e ''s/"php": "\^8.0"/"php": "\^7.4"/'' composer.json' | ||
run: 'sed -i -e ''s/"php": "\^8.1"/"php": "\^${{ matrix.version }}"/'' composer.json' | ||
- name: Update README | ||
run: sed -i '1s/^/# This branch is auto generated\n/' README.md | ||
- name: Commit PHP 7.4 version | ||
uses: actions-x/commit@v2 | ||
- name: Commit PHP ${{ matrix.version }} version | ||
uses: actions-x/commit@v3 | ||
with: | ||
files: . | ||
branch: php-7.4 | ||
branch: php-${{ matrix.version }} | ||
name: GitHub Actions | ||
email: noreply@github.com | ||
message: Transpiled to PHP 7.4 | ||
message: Transpiled to PHP ${{ matrix.version }} | ||
force: true | ||
trigger_7x_tests: | ||
name: Trigger 7.x tests | ||
trigger_tests: | ||
name: Trigger tests | ||
runs-on: ubuntu-latest | ||
needs: | ||
- transpile_73 | ||
- transpile_74 | ||
- transpile | ||
strategy: | ||
matrix: | ||
version: [7x, 8x] | ||
steps: | ||
- name: Trigger 7.x tests | ||
- name: Trigger ${{ matrix.version }} tests | ||
uses: peter-evans/repository-dispatch@v1 | ||
with: | ||
token: ${{ secrets.REPO_TOKEN }} | ||
event-type: trigger-7x-tests | ||
event-type: trigger-${{ matrix.version }}-tests | ||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
use Rector\Set\ValueObject\DowngradeSetList; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->import(DowngradeSetList::PHP_81); | ||
}; |