-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (106 loc) · 4.1 KB
/
be_base.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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@v4
- uses: ./.github/actions/be
- uses: shivammathur/setup-php@v2
with:
# 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"
- 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()
uses: actions/upload-artifact@v4
with:
name: coverage-${{ inputs.runs-on }}
path: be/coverage/clover.xml
compression-level: 9
- if: always()
run: ./vendor/bin/infection --coverage=coverage --skip-initial-tests
phan:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- if: runner.os == 'Windows'
uses: shivammathur/setup-php@v2
with: # https://github.com/shivammathur/setup-php/wiki/Php-extensions-loaded-on-windows-2022/aee619eb6d77e86b17a76d458316b41e58a3b677
extensions: ast # phan/phan requires https://github.com/nikic/php-ast but it's not enabled by default on windows
- run: >
./vendor/bin/phan --output-mode checkstyle --config-file phan.php --analyze-twice --no-progress-bar
| 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@v4
- uses: ./.github/actions/be
- run: >
./vendor/bin/phpstan analyze --error-format=checkstyle
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
shell: bash
psalm:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- 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@v4
- 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
pint:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- run: >
./vendor/bin/pint --test --format=checkstyle
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
shell: bash
php-cs-fixer:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- run: >
./vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
shell: bash
phpmd:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- run: >
./vendor/bin/phpmd . checkstyle phpmd.xml
| tee >(cs2pr --notices-as-warnings --graceful-warnings --prepend-filename --prepend-source)
shell: bash