Skip to content

Commit c83e349

Browse files

File tree

2 files changed

+73
-3
lines changed

2 files changed

+73
-3
lines changed

azure-pipelines.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ jobs:
1616
parameters:
1717
configurationName: DEBUG_NTS
1818
configurationParameters: '--enable-debug --disable-maintainer-zts'
19-
- template: azure/job.yml
19+
# - template: azure/job.yml
20+
# parameters:
21+
# configurationName: RELEASE_ZTS
22+
# configurationParameters: '--disable-debug --enable-maintainer-zts'
23+
- template: azure/coverage_job.yml
2024
parameters:
21-
configurationName: RELEASE_ZTS
22-
configurationParameters: '--disable-debug --enable-maintainer-zts'
25+
configurationName: COVERAGE
26+
configurationParameters: '--enable-debug --disable-maintainer-zts --enable-gcov'
27+
packages: 'lcov gcovr'
2328
# - template: azure/i386/job.yml
2429
# parameters:
2530
# configurationName: I386_DEBUG_ZTS

azure/coverage_job.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
parameters:
2+
configurationName: ''
3+
configurationParameters: ''
4+
runTestsParameters: ''
5+
timeoutInMinutes: 60
6+
7+
jobs:
8+
- job: ${{ parameters.configurationName }}
9+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
10+
pool:
11+
vmImage: 'ubuntu-latest'
12+
steps:
13+
- template: apt.yml
14+
parameters:
15+
configurationParameters: lcov gcovr
16+
- template: configure.yml
17+
parameters:
18+
configurationParameters: ${{ parameters.configurationParameters }}
19+
- script: make -j$(/usr/bin/nproc) >/dev/null
20+
displayName: 'Make Build'
21+
- script: |
22+
sudo make install
23+
sudo mkdir /etc/php.d
24+
sudo chmod 777 /etc/php.d
25+
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
26+
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
27+
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
28+
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
29+
displayName: 'Install Build'
30+
- script: |
31+
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
32+
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
33+
sudo -u postgres psql -c "CREATE DATABASE test;"
34+
displayName: 'Setup'
35+
- template: test.yml
36+
parameters:
37+
configurationName: ${{ parameters.configurationName }}
38+
runTestsParameters: ${{ parameters.runTestsParameters }}
39+
- template: test.yml
40+
parameters:
41+
configurationName: ${{ parameters.configurationName }}
42+
runTestsName: 'OpCache'
43+
runTestsParameters: >-
44+
${{ parameters.runTestsParameters }}
45+
-d zend_extension=opcache.so
46+
- script: |
47+
rm -rf coverage.xml | true
48+
gcovr -sr . -o coverage.xml --xml \
49+
-e '.*/ext/bcmath/libbcmath/.*' \
50+
-e '.*/ext/date/lib/.*' \
51+
-e '.*/ext/fileinfo/libmagic/.*' \
52+
-e '.*/ext/gd/libgd/.*' \
53+
-e '.*/ext/hash/sha3/.*' \
54+
-e '.*/ext/mbstring/libmbfl/.*' \
55+
-e '.*/ext/opcache/jit/libudis86/.*' \
56+
-e '.*/ext/pcre/pcre2lib/.*' \
57+
-e '.*/ext/xmlrpc/libxmlrpc/.*'
58+
displayName: 'Coverage ${{ parameters.configurationName }} ${{ parameters.runTestsName }}'
59+
condition: or(succeeded(), failed())
60+
- task: PublishCodeCoverageResults@1
61+
inputs:
62+
codeCoverageTool: 'Cobertura'
63+
summaryFileLocation: coverage.xml
64+
displayName: 'Export ${{ parameters.configurationName }} ${{ parameters.runTestsName }} Coverage'
65+
condition: or(succeeded(), failed())

0 commit comments

Comments
 (0)