2021-08-16 20:20:54 +03:00
|
|
|
parameters:
|
2022-10-04 02:48:37 +03:00
|
|
|
arch: 'x86_64'
|
2022-03-20 01:42:54 +03:00
|
|
|
coverage: 'OFF'
|
2021-08-16 20:20:54 +03:00
|
|
|
|
|
|
|
jobs:
|
2022-03-20 01:42:54 +03:00
|
|
|
- job: 'Serenity_Clang_${{ parameters.arch }}_Coverage_${{ parameters.coverage }}'
|
2021-08-16 20:20:54 +03:00
|
|
|
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
|
|
|
|
|
|
|
|
variables:
|
2022-01-08 00:08:37 +03:00
|
|
|
- name: LLVM_CCACHE_DIR
|
|
|
|
value: $(Build.SourcesDirectory)/Toolchain/.ccache
|
|
|
|
- name: LLVM_CCACHE_MAXSIZE
|
|
|
|
value: 20GB
|
2021-09-21 13:42:35 +03:00
|
|
|
- name: SERENITY_CCACHE_DIR
|
2021-08-16 20:20:54 +03:00
|
|
|
value: $(Build.SourcesDirectory)/.ccache
|
|
|
|
|
|
|
|
pool:
|
2022-05-23 23:12:57 +03:00
|
|
|
vmImage: ubuntu-22.04
|
2021-08-16 20:20:54 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- template: Setup.yml
|
|
|
|
parameters:
|
|
|
|
os: 'Serenity'
|
|
|
|
|
|
|
|
- template: Caches.yml
|
|
|
|
parameters:
|
|
|
|
arch: '${{ parameters.arch }}'
|
2022-03-20 01:42:54 +03:00
|
|
|
coverage: '${{ parameters.coverage }}'
|
2021-08-16 20:20:54 +03:00
|
|
|
toolchain: 'clang'
|
2022-11-26 05:03:42 +03:00
|
|
|
download_cache_path: 'Build/caches'
|
2022-01-08 00:08:37 +03:00
|
|
|
toolchain_ccache_path: '$(LLVM_CCACHE_DIR)'
|
|
|
|
toolchain_ccache_size: '$(LLVM_CCACHE_MAXSIZE)'
|
2021-09-21 13:42:35 +03:00
|
|
|
serenity_ccache_path: '$(SERENITY_CCACHE_DIR)'
|
2021-08-16 20:20:54 +03:00
|
|
|
|
2022-01-08 00:08:37 +03:00
|
|
|
- script: ./Toolchain/BuildClang.sh --ci
|
2022-12-28 16:47:28 +03:00
|
|
|
displayName: Build Toolchain
|
2021-08-16 20:20:54 +03:00
|
|
|
env:
|
|
|
|
TRY_USE_LOCAL_TOOLCHAIN: 'y'
|
|
|
|
|
|
|
|
- script: |
|
2021-09-07 11:21:36 +03:00
|
|
|
mkdir -p Build/superbuild
|
2021-08-16 20:20:54 +03:00
|
|
|
displayName: 'Create Build Directory'
|
|
|
|
|
|
|
|
- script: |
|
2021-09-07 11:21:36 +03:00
|
|
|
cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \
|
2021-08-16 20:20:54 +03:00
|
|
|
-DSERENITY_ARCH=${{ parameters.arch }} \
|
2021-09-07 11:21:36 +03:00
|
|
|
-DSERENITY_TOOLCHAIN=Clang \
|
2021-08-16 20:20:54 +03:00
|
|
|
-DENABLE_UNDEFINED_SANITIZER=ON \
|
2022-03-20 01:42:54 +03:00
|
|
|
-DENABLE_USERSPACE_COVERAGE_COLLECTION=${{ parameters.coverage }} \
|
2022-09-02 22:29:11 +03:00
|
|
|
-DDUMP_REGIONS_ON_CRASH=ON \
|
2021-08-16 20:20:54 +03:00
|
|
|
-DENABLE_PCI_IDS_DOWNLOAD=OFF \
|
|
|
|
-DENABLE_USB_IDS_DOWNLOAD=OFF \
|
2022-10-25 22:28:09 +03:00
|
|
|
-DCMAKE_C_COMPILER=gcc-12 \
|
|
|
|
-DCMAKE_CXX_COMPILER=g++-12
|
2021-08-16 20:20:54 +03:00
|
|
|
displayName: 'Create Build Environment'
|
2021-09-07 11:21:36 +03:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)
|
2021-09-21 13:42:35 +03:00
|
|
|
env:
|
|
|
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
2021-08-16 20:20:54 +03:00
|
|
|
|
|
|
|
- script: |
|
2021-09-07 11:21:36 +03:00
|
|
|
cmake --build ./Build/superbuild
|
2021-08-16 20:20:54 +03:00
|
|
|
displayName: 'Build'
|
2021-09-07 11:21:36 +03:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)
|
2021-09-21 13:42:35 +03:00
|
|
|
env:
|
|
|
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
2021-08-16 20:20:54 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
ninja install && ninja image
|
|
|
|
displayName: 'Create RootFS'
|
2021-09-07 11:21:36 +03:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
|
2021-08-16 20:20:54 +03:00
|
|
|
|
|
|
|
- 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
|
2022-03-20 01:42:54 +03:00
|
|
|
sudo umount fsmount
|
2021-08-16 20:20:54 +03:00
|
|
|
displayName: 'Test'
|
2021-09-07 11:21:36 +03:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
|
2021-08-19 23:48:30 +03:00
|
|
|
timeoutInMinutes: 60
|
2021-08-16 20:20:54 +03:00
|
|
|
env:
|
|
|
|
SERENITY_QEMU_CPU: 'max,vmx=off'
|
2022-08-12 08:37:23 +03:00
|
|
|
SERENITY_KERNEL_CMDLINE: 'graphics_subsystem_mode=off panic=shutdown system_mode=self-test'
|
2021-08-16 20:20:54 +03:00
|
|
|
SERENITY_RUN: 'ci'
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
[ ! -e debug.log ] || cat debug.log
|
|
|
|
displayName: 'Print Target Logs'
|
2021-09-07 11:21:36 +03:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
|
2021-08-17 23:22:39 +03:00
|
|
|
condition: failed()
|
2021-08-16 20:20:54 +03:00
|
|
|
|
2022-03-20 01:42:54 +03:00
|
|
|
- ${{ 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'
|
|
|
|
|
|
|
|
|
2021-08-16 20:20:54 +03:00
|
|
|
- script: |
|
2021-09-21 13:50:41 +03:00
|
|
|
echo "##[section]Toolchain Cache"
|
|
|
|
CCACHE_DIR='$(LLVM_CCACHE_DIR)' ccache -s
|
|
|
|
|
|
|
|
echo "##[section]Serenity Cache"
|
2021-09-21 13:42:35 +03:00
|
|
|
CCACHE_DIR='$(SERENITY_CCACHE_DIR)' ccache -s
|
2021-08-16 20:20:54 +03:00
|
|
|
displayName: 'Cache Stats'
|