-
Notifications
You must be signed in to change notification settings - Fork 31
68 lines (66 loc) · 2.35 KB
/
pull_request.yml
File metadata and controls
68 lines (66 loc) · 2.35 KB
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
---
on: pull_request
name: Code style review
permissions:
contents: read
pull-requests: write
jobs:
php-versions:
name: Lookup PHP versions
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- uses: antfroger/php-version-action@v1
id: versions
review_codestyle:
name: Codestyle
runs-on: ubuntu-24.04
needs: php-versions
strategy:
matrix:
php-version: ${{ fromJSON(needs.php-versions.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-version }}
coverage: none
- name: Install Reviewdog
run: |
wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b "${PWD}/" latest
- name: Install Dependencies
run: |
composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Check codestyle
run: |
vendor/bin/phpcs bin/ src/ --report=checkstyle | ./reviewdog -f=checkstyle -name=PHPCS -reporter=github-pr-check
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
static_code_analysis:
name: Static Code Analysis
runs-on: ubuntu-24.04
needs: php-versions
strategy:
matrix:
php-version: ${{ fromJSON(needs.php-versions.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-version }}
coverage: none
- name: Install Reviewdog
run: |
wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b "${PWD}/" latest
- name: Install Dependencies
run: |
composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Static code analysis
run: |
php -d memory_limit=1G vendor/bin/phpstan analyse . --error-format=checkstyle | ./reviewdog -f=checkstyle -name=PHPStan -reporter=github-pr-check
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}