Skip to content

Commit

Permalink
Transform source code on PHP 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 27, 2022
1 parent 6a0202b commit 8a314f4
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backward-compatibility.yml
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.0"
php-version: "8.1"

- name: "Install dependencies"
run: "composer install --no-dev --no-interaction --no-progress"
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/e2e-tests.yml
Expand Up @@ -33,8 +33,6 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
operating-system: [ubuntu-latest, windows-latest]

steps:
Expand All @@ -45,7 +43,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
php-version: "8.1"
extensions: mbstring
ini-values: memory_limit=256M

Expand Down Expand Up @@ -82,7 +80,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.0"
php-version: "8.1"
tools: ${{ matrix.tools }}
extensions: ${{ matrix.extensions }}

Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/lint.yml
Expand Up @@ -49,7 +49,7 @@ jobs:
run: "composer install --no-interaction --no-progress"

- name: "Install PHP for code transform"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
Expand All @@ -58,25 +58,25 @@ jobs:

- name: "Rector downgrade cache key"
id: rector-cache-key
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
run: |
echo "::set-output name=sha::$(php build/rector-cache-files-hash.php)"
- name: "Rector downgrade cache"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: actions/cache@v3
with:
path: ./tmp/rectorCache.php
key: "rector-v1-lint-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}"
key: "rector-v2-lint-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}"
restore-keys: |
rector-v1-lint-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-
rector-v2-lint-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-
- name: "Transform source code"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
run: "build/transform-source ${{ matrix.php-version }}"

- name: "Reinstall matrix PHP version"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
Expand All @@ -91,11 +91,6 @@ jobs:
runs-on: "ubuntu-latest"
timeout-minutes: 60

strategy:
matrix:
php-version:
- "8.0"

steps:
- name: "Checkout"
uses: actions/checkout@v3
Expand All @@ -104,7 +99,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
php-version: "8.1"

- name: "Validate Composer"
run: "composer validate"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phar.yml
Expand Up @@ -60,9 +60,9 @@ jobs:
uses: actions/cache@v3
with:
path: ./tmp/rectorCache.php
key: "rector-v1-phar-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ steps.rector-cache-key.outputs.sha }}"
key: "rector-v2-phar-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ steps.rector-cache-key.outputs.sha }}"
restore-keys: |
rector-v1-phar-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-
rector-v2-phar-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-
- name: "Prepare for PHAR compilation"
working-directory: "compiler"
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/static-analysis.yml
Expand Up @@ -56,7 +56,7 @@ jobs:
run: "composer install --no-interaction --no-progress"

- name: "Install PHP for code transform"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
Expand All @@ -65,26 +65,26 @@ jobs:

- name: "Rector downgrade cache key"
id: rector-cache-key
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
run: |
echo "::set-output name=sha::$(php build/rector-cache-files-hash.php)"
- name: "Rector downgrade cache"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: actions/cache@v3
with:
path: ./tmp/rectorCache.php
key: "rector-v1-sa-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}"
key: "rector-v2-sa-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}"
restore-keys: |
rector-v1-sa-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-
rector-v2-sa-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-
- name: "Transform source code"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
shell: bash
run: "build/transform-source ${{ matrix.php-version }}"

- name: "Reinstall matrix PHP version"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
Expand All @@ -108,7 +108,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"

Expand Down Expand Up @@ -153,11 +152,6 @@ jobs:
runs-on: "ubuntu-latest"
timeout-minutes: 60

strategy:
matrix:
php-version:
- "8.0"

steps:
- name: "Checkout"
uses: actions/checkout@v3
Expand All @@ -166,7 +160,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
php-version: "8.1"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Expand Up @@ -57,7 +57,7 @@ jobs:
run: "composer install --no-interaction --no-progress"

- name: "Install PHP for code transform"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
Expand All @@ -66,26 +66,26 @@ jobs:

- name: "Rector downgrade cache key"
id: rector-cache-key
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
run: |
echo "::set-output name=sha::$(php build/rector-cache-files-hash.php)"
- name: "Rector downgrade cache"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: actions/cache@v3
with:
path: ./tmp/rectorCache.php
key: "rector-v1-tests-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}"
key: "rector-v2-tests-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}"
restore-keys: |
rector-v1-tests-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-
rector-v2-tests-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-
- name: "Transform source code"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
shell: bash
run: "build/transform-source ${{ matrix.php-version }}"

- name: "Reinstall matrix PHP version"
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
Expand Down Expand Up @@ -187,17 +187,17 @@ jobs:

- name: "Rector downgrade cache key"
id: rector-cache-key
if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2'
if: matrix.php-version != '8.1' && matrix.php-version != '8.2'
run: |
echo "::set-output name=sha::$(php build/rector-cache-files-hash.php)"
- name: "Rector downgrade cache"
uses: actions/cache@v3
with:
path: ./tmp/rectorCache.php
key: "rector-v1-tests-old-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}"
key: "rector-v2-tests-old-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}"
restore-keys: |
rector-v1-tests-old-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-
rector-v2-tests-old-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-
- name: "Transform source code"
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-phpstorm-stubs.yml
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.0"
php-version: "8.1"
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"
- name: "Checkout stubs"
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/phpstan.neon
Expand Up @@ -2,4 +2,5 @@ includes:
- baseline.neon

parameters:
phpVersion: 80000
tmpDir: tmp
1 change: 1 addition & 0 deletions tests/e2e/phpstan_resultcachepath.neon
Expand Up @@ -2,4 +2,5 @@ includes:
- baseline.neon

parameters:
phpVersion: 80000
resultCachePath: %tmpDir%/myResultCacheFile.php

0 comments on commit 8a314f4

Please sign in to comment.