-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (144 loc) · 5.67 KB
/
build.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: build
on: [push, pull_request]
jobs:
quality-check:
name: "Coding standards & test coverage"
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.4']
env:
extensions: pcov, dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
key: cache-v3
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Setup PHP extensions cache environment"
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: "Cache PHP extensions"
uses: actions/cache@v3
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
extensions: ${{ env.extensions }}
ini-values: assert.exception=1, zend.assertions=1
- name: "Install Composer dependencies"
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
composer-options: --prefer-stable
custom-cache-key: composer-${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }}
- name: "Coding standard Php-CS-Fixer checks"
run: vendor/bin/php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests
- name: "Coding standard CodeSniffer checks"
run: |
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml --colors src
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml --colors --ignore=*/code-samples/* tests
- name: "Package skeleton validation"
run: vendor/bin/polymorphine-skeleton check
- name: "Run PhpUnit tests with coverage"
run: |
mkdir -p .dev/logs
vendor/bin/phpunit --coverage-clover .dev/logs/clover.xml
- name: "Send coverage report to coveralls.io"
run: |
composer require php-coveralls/php-coveralls
vendor/bin/php-coveralls -v -o .dev/logs/coveralls-upload.json -x .dev/logs/clover.xml
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
platform-compatibility:
name: "Operating systems"
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
php-versions: ['8.4']
env:
extensions: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
key: cache-v3
steps:
- name: "Turn off git EOL conversion"
run: git config --global core.autocrlf false
- name: "Checkout"
uses: actions/checkout@v3
- name: "Setup PHP extensions cache environment"
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: "Cache PHP extensions"
uses: actions/cache@v3
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
extensions: ${{ env.extensions }}
ini-values: assert.exception=1, zend.assertions=1
- name: "Install Composer dependencies"
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
composer-options: --prefer-stable
custom-cache-key: composer-${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }}
- name: "Run PhpUnit tests (no coverage)"
run: vendor/bin/phpunit --no-coverage
php-versions:
name: "PHP versions"
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.0', '8.1', '8.2', '8.3']
env:
extensions: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
key: cache-v3
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Setup PHP extensions cache environment"
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: "Cache PHP extensions"
uses: actions/cache@v3
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
extensions: ${{ env.extensions }}
ini-values: assert.exception=1, zend.assertions=1
- name: "Install Composer dependencies"
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
composer-options: --prefer-stable
custom-cache-key: composer-${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }}
- name: "Run PhpUnit tests (no coverage)"
run: vendor/bin/phpunit --no-coverage