-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (102 loc) · 4.25 KB
/
Copy pathbe_base.yaml
File metadata and controls
108 lines (102 loc) · 4.25 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
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
name: be/base
on:
workflow_call:
inputs:
runs-on:
required: true
type: string
defaults:
run:
working-directory: be
jobs:
phpunit-infection:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/be
- uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
# https://bugs.php.net/bug.php?id=80608 https://github.com/swoole/swoole-src/issues/3986 https://github.com/php/php-src/pull/6640
# PHP Warning: JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled.
ini-values: opcache.jit_buffer_size=0
coverage: xdebug
# https://github.com/shivammathur/setup-php/blob/2.31.1/README.md#problem-matchers
- run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- id: phpunit
run: >
./vendor/bin/phpunit
--coverage-clover=coverage/clover.xml
--coverage-xml=coverage/coverage-xml
--log-junit=coverage/junit.xml
# https://infection.github.io/guide/command-line-options.html#coverage
- if: always() && (steps.phpunit.outcome == 'success' || steps.phpunit.outcome == 'failure')
uses: actions/upload-artifact@v7
with:
name: coverage-${{ inputs.runs-on }}
path: be/coverage/clover.xml
compression-level: 9
- if: always() && (steps.phpunit.outcome == 'success' || steps.phpunit.outcome == 'failure')
run: ./vendor/bin/infection --coverage=coverage --skip-initial-tests
phan:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/be
- if: runner.os == 'Windows' || runner.os == 'macOS'
uses: shivammathur/setup-php@v2
with:
# `phan/phan` requires https://github.com/nikic/php-ast but it's not installed by default on the Windows and macOS images of hosted runner
# https://github.com/shivammathur/setup-php/wiki/Php-extensions-loaded-on-windows-2025/298f253ff19de7820dddf397ba52c7fa82a7a3eb
# https://github.com/shivammathur/setup-php/wiki/Php-extensions-loaded-on-macos-15/74bc20f907f0a580e8f5cd949c9d872a5193f970
extensions: ast
- run: >
./vendor/bin/phan --output-mode checkstyle --config-file phan.php --analyze-twice
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
# https://github.com/staabm/annotate-pull-request-from-checkstyle
shell: bash
phpstan:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/be
- run: >
./vendor/bin/phpstan analyze --error-format=checkstyle --no-interaction
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
shell: bash
psalm:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/be
- run: >
./vendor/bin/psalm --output-format=checkstyle
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
shell: bash
phpcs:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/be
- id: run
run: ./vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml .
- if: always() && steps.run.outcome == 'failure'
run: cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source ./phpcs-report.xml
php-cs-fixer:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/be
- run: >
./vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle --no-interaction --show-progress dots
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
shell: bash
phpmd:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/be
- run: >
./vendor/bin/phpmd . checkstyle phpmd.xml
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
shell: bash