ladybird/Meta/Azure/Serenity.yml
Timothy Flynn 4cc8266727 CI: Do not prune the toolchain ccache
Currently, if the prebuilt toolchain cache gets used, we will not try to
build the toolchain. Thus, the toolchain's ccache does not get used, and
is then pruned entirely at the end of the run.

So for now, let's just not prune the toolchain ccache. After a few years
it only reached 0.8 GB in size. And now that we are starting from empty
again, it would likely be a few more years before we reach 0.8 GB again.
2024-04-24 16:49:50 -04:00

137 lines
4.4 KiB
YAML

parameters:
arch: 'x86_64'
coverage: 'OFF'
jobs:
- job: 'Serenity_Clang_${{ parameters.arch }}_Coverage_${{ parameters.coverage }}'
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
variables:
- name: LLVM_CCACHE_DIR
value: $(Build.SourcesDirectory)/Toolchain/.ccache
- name: SERENITY_CCACHE_DIR
value: $(Build.SourcesDirectory)/.ccache
pool:
vmImage: ubuntu-22.04
steps:
- template: Setup.yml
parameters:
os: 'Serenity'
- template: Caches.yml
parameters:
arch: '${{ parameters.arch }}'
coverage: '${{ parameters.coverage }}'
toolchain: 'clang'
download_cache_path: 'Build/caches'
toolchain_ccache_path: '$(LLVM_CCACHE_DIR)'
serenity_ccache_path: '$(SERENITY_CCACHE_DIR)'
- script: ./Toolchain/BuildClang.sh --ci
displayName: Build Toolchain
env:
TRY_USE_LOCAL_TOOLCHAIN: 'y'
- script: |
mkdir -p Build/superbuild
displayName: 'Create Build Directory'
- script: |
set -e
cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \
-DSERENITY_ARCH=${{ parameters.arch }} \
-DSERENITY_TOOLCHAIN=Clang \
-DENABLE_UNDEFINED_SANITIZER=ON \
-DUNDEFINED_BEHAVIOR_IS_FATAL=ON \
-DENABLE_USERSPACE_COVERAGE_COLLECTION=${{ parameters.coverage }} \
-DDUMP_REGIONS_ON_CRASH=ON \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF \
-DCMAKE_C_COMPILER=gcc-13 \
-DCMAKE_CXX_COMPILER=g++-13
displayName: 'Create Build Environment'
workingDirectory: $(Build.SourcesDirectory)
env:
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
- script: |
set -e
cmake --build ./Build/superbuild
displayName: 'Build'
workingDirectory: $(Build.SourcesDirectory)
env:
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
- script: |
set -e
ninja install && ninja qemu-image
displayName: 'Create RootFS'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
- script: |
set -e
ninja run
echo "##[group]Verify Output File"
mkdir fsmount
sudo mount -t ext2 -o loop,rw _disk_image fsmount
echo "Results: "
sudo cat fsmount/home/anon/test-results.log
echo "##[endgroup]"
if ! sudo grep -q "Failed: 0" fsmount/home/anon/test-results.log
then
echo "##[error]:^( Tests failed, failing job"
exit 1
fi
sudo umount fsmount
displayName: 'Test'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
timeoutInMinutes: 60
env:
SERENITY_QEMU_CPU: 'max,vmx=off'
SERENITY_KERNEL_CMDLINE: 'graphics_subsystem_mode=off panic=shutdown system_mode=self-test'
SERENITY_RUN: 'ci'
- script: |
[ ! -e debug.log ] || cat debug.log
displayName: 'Print Target Logs'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
condition: failed()
- ${{ if eq(parameters.coverage, 'ON') }}:
- script: |
set -e
./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: |
echo "##[section]Serenity Cache"
CCACHE_DIR='$(SERENITY_CCACHE_DIR)' ccache --evict-older-than 1d
displayName: 'Prune obsolete ccache files'
- script: |
echo "##[section]Toolchain Cache"
CCACHE_DIR='$(LLVM_CCACHE_DIR)' ccache -s
echo "##[section]Serenity Cache"
CCACHE_DIR='$(SERENITY_CCACHE_DIR)' ccache -s
displayName: 'Cache Stats'