-
Notifications
You must be signed in to change notification settings - Fork 8
90 lines (75 loc) · 3.15 KB
/
php.yml
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
name: PHP Composer
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
pull-requests: write
issues: write
repository-projects: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '8.0', '8.1' ]
symfony-version: [ '5.4.*', '6.*' ]
symfony-deprecations-helper: [ 'max[direct]=0&baselineFile=./tests/allowed.json' ]
grumphp-testsuite: [ 'no-analyse' ]
include:
- php-version: '7.4'
symfony-version: '5.4.*'
symfony-deprecations-helper: 'disabled=1&max[indirect]=99999&baselineFile=./tests/allowed.json'
composer-flag: '--prefer-lowest'
grumphp-flag: '-lowest'
grumphp-testsuite: 'no-analyse'
- php-version: '7.4'
symfony-version: '5.4.*'
symfony-deprecations-helper: 'max[direct]=0&max[indirect]=99999&baselineFile=./tests/allowed.json'
grumphp-testsuite: 'main'
name: "PHP: ${{ matrix.php-version }}, Symfony: ${{ matrix.symfony-version }}, GrumPHP: ${{ matrix.grumphp-testsuite }}, Composer: ${{ matrix.composer-flag }}"
steps:
- uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Check PHP Version
run: php -v
- name: Symfony version # run every time except for dependencies with SF 5.4 (locked in composer)
if: ${{ matrix.grumphp-testsuite == 'no-analyse' }}
run: composer config extra.symfony.require ${{ matrix.symfony-version }}
- name: Composer update # run for everything except php 7.4 or SF 5.4 locked in composer.lock
if: ${{ matrix.php-version != '7.4' && matrix.symfony-version != '5.4.*' }}
run: composer update ${{ matrix.composer-flag }} --prefer-dist --no-interaction
- name: Composer install # only run for locked dependencies with php 7.4 or SF 5.4 (locked in composer)
if: ${{ matrix.php-version == '7.4' || matrix.symfony-version == '5.4.*' }}
run: composer install --prefer-dist --no-interaction
- name: Run static analysis (GrumPHP)
run: composer run-script grumphp${{ matrix.php-version }}${{ matrix.grumphp-flag }}
- name: Check vendor licenses
run: composer run-script lic-check
dependabot:
needs: [ build ]
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve a dependabot PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}