ladybird/Meta/Azure/Serenity.yml
Timothy Flynn 3938a2cca7 CI: Extract toolchain ccache in the Serenity build stage
The toolchain is built in a previous stage, but once the Serenity stage
has begun, we have to re-pull the toolchain from the Azure cache. There
is a timing window where a cache-busting change can be commited between
these steps; to alleviate the affect this has, pull the toolchain ccache
so that the build only takes a few minutes instead of a couple hours.
2022-01-07 18:16:30 -08:00

105 lines
3.1 KiB
YAML

parameters:
arch: 'i686'
jobs:
- job: 'Serenity_Clang_${{ parameters.arch }}'
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
variables:
- name: LLVM_CCACHE_DIR
value: $(Build.SourcesDirectory)/Toolchain/.ccache
- name: LLVM_CCACHE_MAXSIZE
value: 20GB
- name: SERENITY_CCACHE_DIR
value: $(Build.SourcesDirectory)/.ccache
pool:
vmImage: ubuntu-20.04
steps:
- template: Setup.yml
parameters:
os: 'Serenity'
- template: Caches.yml
parameters:
arch: '${{ parameters.arch }}'
toolchain: 'clang'
build_directory: 'Build/${{ parameters.arch }}clang'
toolchain_ccache_path: '$(LLVM_CCACHE_DIR)'
toolchain_ccache_size: '$(LLVM_CCACHE_MAXSIZE)'
serenity_ccache_path: '$(SERENITY_CCACHE_DIR)'
- script: ./Toolchain/BuildClang.sh --ci
displayName: Extract Toolchain
env:
TRY_USE_LOCAL_TOOLCHAIN: 'y'
- script: |
mkdir -p Build/superbuild
displayName: 'Create Build Directory'
- script: |
cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \
-DSERENITY_ARCH=${{ parameters.arch }} \
-DSERENITY_TOOLCHAIN=Clang \
-DENABLE_UNDEFINED_SANITIZER=ON \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF \
-DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-11
displayName: 'Create Build Environment'
workingDirectory: $(Build.SourcesDirectory)
env:
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
- script: |
cmake --build ./Build/superbuild
displayName: 'Build'
workingDirectory: $(Build.SourcesDirectory)
env:
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
- script: |
ninja install && ninja image
displayName: 'Create RootFS'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
- script: |
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
displayName: 'Test'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
timeoutInMinutes: 60
env:
SERENITY_QEMU_CPU: 'max,vmx=off'
SERENITY_KERNEL_CMDLINE: 'fbdev=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()
- 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'