-
Notifications
You must be signed in to change notification settings - Fork 9
53 lines (52 loc) · 1.67 KB
/
transpile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Transpile to older versions
on:
push:
branches:
- main
workflow_dispatch:
jobs:
transpile:
name: Transpile to older versions of PHP
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.3', '7.4', '8.0', '8.1']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Dependencies
run: composer install
- 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.2"/"php": "\^${{ matrix.version }}"/'' composer.json'
- name: Update README
run: sed -i '1s/^/# This branch is auto generated\n/' README.md
- name: Commit PHP ${{ matrix.version }} version
uses: actions-x/commit@v6
with:
files: .
branch: php-${{ matrix.version }}
name: GitHub Actions
email: noreply@github.com
message: Transpiled to PHP ${{ matrix.version }}
force: true
trigger_tests:
name: Trigger tests
runs-on: ubuntu-latest
needs:
- transpile
strategy:
matrix:
version: [7x, 8x]
steps:
- name: Trigger ${{ matrix.version }} tests
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_TOKEN }}
event-type: trigger-${{ matrix.version }}-tests
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'