mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:57:45 +00:00
CI: Add x86_64 Clang Coverage pipeline in Azure
Add a job to the Azure pipelines to run tests with coverage enabled, and aggregate the test results in a folder of html pages showing the coverage results overall, and per-file. Future work is needed to take the published pipeline artifact for the coverage results and display them somewhere interesting.
This commit is contained in:
parent
3e32fb911e
commit
44bcd7c7aa
3 changed files with 50 additions and 3 deletions
|
@ -2,6 +2,7 @@ parameters:
|
||||||
os: 'Linux'
|
os: 'Linux'
|
||||||
arch: 'i686'
|
arch: 'i686'
|
||||||
toolchain: 'gcc'
|
toolchain: 'gcc'
|
||||||
|
coverage: 'OFF'
|
||||||
build_directory: ''
|
build_directory: ''
|
||||||
ccache_version: 1 # Increment this number if CI has trouble with ccache.
|
ccache_version: 1 # Increment this number if CI has trouble with ccache.
|
||||||
serenity_ccache_path: ''
|
serenity_ccache_path: ''
|
||||||
|
@ -45,9 +46,9 @@ steps:
|
||||||
- ${{ if ne(parameters.serenity_ccache_path, '') }}:
|
- ${{ if ne(parameters.serenity_ccache_path, '') }}:
|
||||||
- task: Cache@2
|
- task: Cache@2
|
||||||
inputs:
|
inputs:
|
||||||
key: '"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}" | "$(timestamp)"'
|
key: '"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.coverage }}" | "${{ parameters.ccache_version }}" | "$(timestamp)"'
|
||||||
restoreKeys: |
|
restoreKeys: |
|
||||||
"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}"
|
"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.coverage }}" | "${{ parameters.ccache_version }}"
|
||||||
path: ${{ parameters.serenity_ccache_path }}
|
path: ${{ parameters.serenity_ccache_path }}
|
||||||
displayName: 'Serenity Compiler Cache'
|
displayName: 'Serenity Compiler Cache'
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
parameters:
|
parameters:
|
||||||
arch: 'i686'
|
arch: 'i686'
|
||||||
|
coverage: 'OFF'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: 'Serenity_Clang_${{ parameters.arch }}'
|
- job: 'Serenity_Clang_${{ parameters.arch }}_Coverage_${{ parameters.coverage }}'
|
||||||
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
|
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
|
@ -24,6 +25,7 @@ jobs:
|
||||||
- template: Caches.yml
|
- template: Caches.yml
|
||||||
parameters:
|
parameters:
|
||||||
arch: '${{ parameters.arch }}'
|
arch: '${{ parameters.arch }}'
|
||||||
|
coverage: '${{ parameters.coverage }}'
|
||||||
toolchain: 'clang'
|
toolchain: 'clang'
|
||||||
build_directory: 'Build/${{ parameters.arch }}clang'
|
build_directory: 'Build/${{ parameters.arch }}clang'
|
||||||
toolchain_ccache_path: '$(LLVM_CCACHE_DIR)'
|
toolchain_ccache_path: '$(LLVM_CCACHE_DIR)'
|
||||||
|
@ -44,6 +46,7 @@ jobs:
|
||||||
-DSERENITY_ARCH=${{ parameters.arch }} \
|
-DSERENITY_ARCH=${{ parameters.arch }} \
|
||||||
-DSERENITY_TOOLCHAIN=Clang \
|
-DSERENITY_TOOLCHAIN=Clang \
|
||||||
-DENABLE_UNDEFINED_SANITIZER=ON \
|
-DENABLE_UNDEFINED_SANITIZER=ON \
|
||||||
|
-DENABLE_USERSPACE_COVERAGE_COLLECTION=${{ parameters.coverage }} \
|
||||||
-DENABLE_PCI_IDS_DOWNLOAD=OFF \
|
-DENABLE_PCI_IDS_DOWNLOAD=OFF \
|
||||||
-DENABLE_USB_IDS_DOWNLOAD=OFF \
|
-DENABLE_USB_IDS_DOWNLOAD=OFF \
|
||||||
-DCMAKE_C_COMPILER=gcc-11 \
|
-DCMAKE_C_COMPILER=gcc-11 \
|
||||||
|
@ -81,6 +84,7 @@ jobs:
|
||||||
echo "##[error]:^( Tests failed, failing job"
|
echo "##[error]:^( Tests failed, failing job"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
sudo umount fsmount
|
||||||
displayName: 'Test'
|
displayName: 'Test'
|
||||||
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
|
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
|
||||||
timeoutInMinutes: 60
|
timeoutInMinutes: 60
|
||||||
|
@ -95,6 +99,27 @@ jobs:
|
||||||
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
|
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
|
||||||
condition: failed()
|
condition: failed()
|
||||||
|
|
||||||
|
- ${{ if eq(parameters.coverage, 'ON') }}:
|
||||||
|
- script: |
|
||||||
|
./Meta/analyze-qemu-coverage.sh
|
||||||
|
displayName: 'Aggregate Coverage Results'
|
||||||
|
workingDirectory: $(Build.SourcesDirectory)
|
||||||
|
env:
|
||||||
|
SERENITY_TOOLCHAIN: Clang
|
||||||
|
SERENITY_ARCH: ${{ parameters.arch }}
|
||||||
|
|
||||||
|
# FIXME: Deploy the static html pages somewhere
|
||||||
|
# FIXME: Alter script to also (instead?) produce a raw coverage.txt file for ingestion into sonar cloud
|
||||||
|
# Note: tmp_profile_data/Coverage.profdata has the entire combined profile data, but creating the raw txt requires
|
||||||
|
# all of the instrumented binaries and the profdata file.
|
||||||
|
- ${{ if eq(parameters.coverage, 'ON') }}:
|
||||||
|
- task: PublishPipelineArtifact@1
|
||||||
|
inputs:
|
||||||
|
targetPath: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang/reports
|
||||||
|
artifactType: 'pipeline'
|
||||||
|
artifactName: 'Coverage'
|
||||||
|
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
echo "##[section]Toolchain Cache"
|
echo "##[section]Toolchain Cache"
|
||||||
CCACHE_DIR='$(LLVM_CCACHE_DIR)' ccache -s
|
CCACHE_DIR='$(LLVM_CCACHE_DIR)' ccache -s
|
||||||
|
|
21
Meta/Azure/nightly-pipeline.yml
Normal file
21
Meta/Azure/nightly-pipeline.yml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# Pipeline definition for nightly or other scheduled jobs we don't want to run on every PR in Azure
|
||||||
|
schedules:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
displayName: Daily midnight build
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- stage: Toolchain
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: Meta/Azure/Toolchain.yml
|
||||||
|
|
||||||
|
- stage: SerenityOS (Coverage)
|
||||||
|
dependsOn: Toolchain
|
||||||
|
jobs:
|
||||||
|
- template: Meta/Azure/Serenity.yml
|
||||||
|
parameters:
|
||||||
|
arch: 'x86_64'
|
||||||
|
coverage: 'ON'
|
Loading…
Add table
Add a link
Reference in a new issue