-
-
Notifications
You must be signed in to change notification settings - Fork 862
114 lines (102 loc) · 3.14 KB
/
extension-tests.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
114
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Extension tests"
on:
workflow_call:
inputs:
ref:
description: 'phpstan/phpstan ref to checkout'
required: true
type: string
phar-checksum:
description: 'PHAR checksum from reproducible build (please rebase)'
required: true
type: string
jobs:
check-phar-checksum:
name: "Check PHAR checksum"
runs-on: "ubuntu-latest"
outputs:
checksum-result: ${{ steps.checksum-difference.outputs.result }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
repository: "phpstan/phpstan"
ref: ${{ inputs.ref }}
- name: "Check PHAR checksum"
id: checksum-difference
run: |
checksum=${{ inputs.phar-checksum }}
if [[ $(head -n 1 .phar-checksum) != "$checksum" ]]; then
echo "result=different" >> $GITHUB_OUTPUT
else
echo "result=same" >> $GITHUB_OUTPUT
fi
tests-extensions:
name: "Extension Tests"
runs-on: "ubuntu-latest"
needs: check-phar-checksum
if: "needs.check-phar-checksum.outputs.checksum-result == 'different'"
strategy:
fail-fast: false
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
extension-name:
- "phpstan-phpunit"
- "phpstan-strict-rules"
- "phpstan-mockery"
- "phpstan-doctrine"
- "phpstan-symfony"
- "phpstan-php-parser"
- "phpstan-deprecation-rules"
- "phpdoc-parser"
- "phpstan-nette"
- "phpstan-dibi"
- "phpstan-webmozart-assert"
- "phpstan-beberlei-assert"
exclude:
- extension-name: "phpstan-mockery"
php-version: "7.2"
- extension-name: "phpstan-mockery"
php-version: "7.3"
- extension-name: "phpstan-phpunit"
php-version: "7.2"
- extension-name: "phpstan-doctrine"
php-version: "7.2"
- extension-name: "phpstan-doctrine"
php-version: "8.3"
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
repository: "phpstan/phpstan"
ref: ${{ inputs.ref }}
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-file: development
ini-values: memory_limit=768M
extensions: soap
- name: "Install dependencies"
run: "composer update --no-interaction --no-progress --ignore-platform-reqs"
- name: "Download phpstan.phar"
uses: Wandalen/wretry.action@v3.5.0
with:
action: actions/download-artifact@v4
with: |
name: phar-file
attempt_limit: 5
attempt_delay: 1000
- name: "Extension build"
env:
PHP_VERSION: ${{ matrix.php-version }}
run: "./e2e/test-extension.sh ${{ matrix.extension-name }}"