|
| 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