-
Notifications
You must be signed in to change notification settings - Fork 13
executable file
·111 lines (110 loc) · 3.43 KB
/
tests.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Tests (8.3)
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
code_style:
name: Test code style
runs-on: ubuntu-latest
env:
PHP_CS_FIXER_IGNORE_ENV: 1
strategy:
matrix:
version: ['8.3']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Dependencies
run: composer install
- name: Test code style
run: composer fixer -- --dry-run
static_analysis:
name: Static analysis
runs-on: ubuntu-latest
strategy:
matrix:
version: ['8.3']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Dependencies
run: composer install
- name: Run static analysis
run: composer phpstan
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
version: ['8.3']
optional-deps: ['', 'cache/filesystem-adapter:^1.1']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies (without optional)
if: ${{ matrix.optional-deps == '' }}
run: composer install
- name: Install Dependencies (with optional)
if: ${{ matrix.optional-deps != '' }}
run: composer require ${{ matrix.optional-deps }}
- name: Run tests
run: composer phpunit
testsTranspiled:
name: Tests (transpiled versions)
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
steps:
- name: Setup Build PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies (Build)
run: composer install
- name: Transpile ${{ matrix.version }}
run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.$(echo ${{ matrix.version }} | sed -e 's/\.//').php src
- name: Add polyfill for 7.3
if: matrix.version == '7.2'
run: composer require symfony/polyfill-php73:^1.0
- name: Update composer.json version
run: 'sed -i -e ''s/"php": "\^8.3"/"php": "\^${{ matrix.version }}"/'' composer.json'
- name: Downgrade phpunit
if: matrix.version == '7.2'
run: 'sed -i -e ''s/"phpunit\/phpunit": "\^9.5"/"phpunit\/phpunit": "\^8.5"/'' composer.json'
- name: Copy Bootstrap
if: matrix.version == '7.2'
run: cp .github/bootstrap-72.php src
- name: Load Bootstrap
if: matrix.version == '7.2'
run: 'cat composer.json | jq --argjson files ''["src/bootstrap-72.php"]'' ''.autoload += {files: $files}'' > tmp.json && mv tmp.json composer.json'
- name: Setup Runtime PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
- name: Install Dependencies (Runtime)
run: composer update
- name: Run tests
run: composer phpunit