xref: /PHP-7.4/azure/coverage_job.yml (revision 8f8e6f95)
1parameters:
2  configurationName: ''
3  configurationParameters: ''
4  runTestsParameters: ''
5  timeoutInMinutes: 60
6
7jobs:
8  - job: ${{ parameters.configurationName }}
9    timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
10    pool:
11      vmImage: 'ubuntu-18.04'
12    steps:
13    - template: apt.yml
14    - script: |
15        sudo -H pip install gcovr
16      displayName: 'Install gcovr'
17    - template: configure.yml
18      parameters:
19        configurationParameters: --enable-gcov ${{ parameters.configurationParameters }}
20    - script: make -j$(/usr/bin/nproc) >/dev/null
21      displayName: 'Make Build'
22    - template: install.yml
23    - template: setup.yml
24    - template: test.yml
25      parameters:
26        configurationName: ${{ parameters.configurationName }}
27        runTestsParameters: ${{ parameters.runTestsParameters }}
28    - template: test.yml
29      parameters:
30        configurationName: ${{ parameters.configurationName }}
31        runTestsName: 'OpCache'
32        runTestsParameters: >-
33          ${{ parameters.runTestsParameters }}
34          -d zend_extension=opcache.so
35    - script: bash <(curl -s https://codecov.io/bash)
36      displayName: 'Upload ${{ parameters.configurationName }} Test Coverage to Codecov.io'
37      condition: or(succeeded(), failed())
38    - script: |
39        make gcovr-xml
40        mv gcovr.xml coverage.xml
41      displayName: 'Generate ${{ parameters.configurationName }} Test Coverage Cobertura XML Report'
42      condition: or(succeeded(), failed())
43    - task: PublishCodeCoverageResults@1
44      inputs:
45        codeCoverageTool: 'Cobertura'
46        summaryFileLocation: coverage.xml
47      displayName: 'Publish ${{ parameters.configurationName }} Test Coverage'
48      condition: or(succeeded(), failed())
49