2021-08-16 11:38:50 -04:00
|
|
|
parameters:
|
|
|
|
os: 'Linux'
|
2021-08-17 11:50:23 -04:00
|
|
|
fuzzer: 'NoFuzz'
|
2021-10-04 21:32:31 +02:00
|
|
|
lagom_lints: false
|
2021-08-16 11:38:50 -04:00
|
|
|
|
|
|
|
jobs:
|
2021-08-17 11:50:23 -04:00
|
|
|
- job: 'Lagom_${{ parameters.os }}_${{ parameters.fuzzer }}'
|
2022-02-15 17:46:34 +02:00
|
|
|
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
|
2021-08-16 11:38:50 -04:00
|
|
|
|
|
|
|
variables:
|
2021-09-21 06:42:35 -04:00
|
|
|
- name: SERENITY_CCACHE_DIR
|
2021-08-16 19:02:27 -04:00
|
|
|
value: $(Build.SourcesDirectory)/.ccache
|
2021-08-17 11:50:23 -04:00
|
|
|
|
|
|
|
- name: job_pool
|
2023-09-03 21:14:12 +02:00
|
|
|
${{ if eq(parameters.os, 'Linux') }}:
|
2022-05-23 16:12:57 -04:00
|
|
|
value: ubuntu-22.04
|
2023-09-03 21:14:12 +02:00
|
|
|
${{ if or(eq(parameters.os, 'macOS'), eq(parameters.os, 'Android')) }}:
|
2022-12-23 16:56:44 -07:00
|
|
|
value: macos-12
|
2021-08-16 11:38:50 -04:00
|
|
|
|
2021-08-17 11:50:23 -04:00
|
|
|
- name: toolchain
|
|
|
|
${{ if eq(parameters.fuzzer, 'Fuzz') }}:
|
|
|
|
value: clang
|
|
|
|
${{ if eq(parameters.fuzzer, 'NoFuzz') }}:
|
|
|
|
value: gcc
|
|
|
|
|
2022-12-23 11:39:09 -07:00
|
|
|
- name: host-cc
|
|
|
|
${{ if eq(parameters.os, 'macOS') }}:
|
|
|
|
value: $(brew --prefix llvm@15)/bin/clang
|
|
|
|
${{ if not(eq(parameters.os, 'macOS')) }}:
|
|
|
|
value: gcc-12
|
|
|
|
|
|
|
|
- name: host-cxx
|
|
|
|
${{ if eq(parameters.os, 'macOS') }}:
|
|
|
|
value: $(brew --prefix llvm@15)/bin/clang++
|
|
|
|
${{ if not(eq(parameters.os, 'macOS')) }}:
|
|
|
|
value: g++-12
|
|
|
|
|
2022-07-20 00:13:12 -06:00
|
|
|
- name: ndk_version # only relevant for Android
|
2023-03-15 19:55:16 -06:00
|
|
|
value: '25.2.9519653'
|
2022-07-20 00:13:12 -06:00
|
|
|
|
2021-08-16 11:38:50 -04:00
|
|
|
pool:
|
|
|
|
vmImage: $(job_pool)
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- template: Setup.yml
|
|
|
|
parameters:
|
|
|
|
os: '${{ parameters.os }}'
|
|
|
|
|
2021-08-16 19:02:27 -04:00
|
|
|
- template: Caches.yml
|
|
|
|
parameters:
|
|
|
|
os: '${{ parameters.os }}'
|
|
|
|
arch: 'Lagom'
|
2021-08-17 11:50:23 -04:00
|
|
|
toolchain: '$(toolchain)'
|
2023-08-07 19:13:06 -06:00
|
|
|
download_cache_path: 'Meta/Lagom/caches'
|
2021-09-21 06:42:35 -04:00
|
|
|
serenity_ccache_path: '$(SERENITY_CCACHE_DIR)'
|
2022-08-09 08:30:18 -04:00
|
|
|
with_remote_data_caches: true
|
2022-08-23 09:08:06 -04:00
|
|
|
${{ if eq(parameters.os, 'macOS') }}:
|
|
|
|
ccache_version: 2
|
|
|
|
serenity_ccache_size: '2G'
|
2022-07-20 00:13:12 -06:00
|
|
|
|
|
|
|
- ${{ if eq(parameters.os, 'Android') }}:
|
|
|
|
- script: |
|
|
|
|
yes | $ANDROID_SDK_ROOT/tools/bin/sdkmanager "ndk;$(ndk_version)"
|
|
|
|
displayName: "Install NDK $(ndk_version)"
|
|
|
|
|
|
|
|
- script: |
|
2023-09-03 21:14:12 +02:00
|
|
|
# Install AVD files
|
|
|
|
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-30;google_apis;x86_64'
|
|
|
|
|
|
|
|
# Create emulator
|
|
|
|
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-30;google_apis;x86_64' --force
|
|
|
|
|
|
|
|
$ANDROID_HOME/emulator/emulator -list-avds
|
|
|
|
|
|
|
|
echo "Starting emulator"
|
|
|
|
|
|
|
|
# Start emulator in background
|
|
|
|
nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -no-snapshot > /dev/null 2>&1 &
|
|
|
|
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
|
|
|
|
$ANDROID_HOME/platform-tools/adb devices
|
|
|
|
echo "Emulator started"
|
|
|
|
displayName: "Start Android Emulator"
|
|
|
|
|
|
|
|
- task: Gradle@2
|
|
|
|
inputs:
|
2023-09-14 15:59:33 -06:00
|
|
|
workingDirectory: 'Ladybird/Android'
|
2023-09-03 21:14:12 +02:00
|
|
|
gradleWrapperFile: 'gradlew'
|
|
|
|
gradleOptions: '-Xmx3072m'
|
|
|
|
jdkVersionOption: '17'
|
|
|
|
jdkArchitectureOption: 'x64'
|
|
|
|
publishJUnitResults: true
|
|
|
|
testResultsFiles: '**/TEST-*.xml'
|
|
|
|
tasks: 'connectedAndroidTest'
|
2022-07-20 00:13:12 -06:00
|
|
|
env:
|
|
|
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
2023-09-03 21:14:12 +02:00
|
|
|
SERENITY_CACHE_DIR: "$(Build.SourcesDirectory)/Meta/Lagom/caches"
|
|
|
|
displayName: "Build and Test in Android Emulator"
|
2021-08-16 19:02:27 -04:00
|
|
|
|
2022-07-20 00:13:12 -06:00
|
|
|
- ${{ elseif eq(parameters.fuzzer, 'Fuzz') }}:
|
2021-08-17 11:50:23 -04:00
|
|
|
- script: |
|
2023-03-19 13:17:36 -06:00
|
|
|
set -e
|
2022-02-19 16:09:40 -07:00
|
|
|
cmake -GNinja -B tools-build \
|
|
|
|
-DBUILD_LAGOM=OFF \
|
|
|
|
-DENABLE_LAGOM_CCACHE=ON \
|
2022-07-11 01:07:47 -06:00
|
|
|
-DCMAKE_INSTALL_PREFIX=tool-install \
|
|
|
|
-Dpackage=LagomTools
|
2022-02-19 16:09:40 -07:00
|
|
|
ninja -C tools-build install
|
|
|
|
cmake -GNinja -B Build \
|
2021-08-17 11:50:23 -04:00
|
|
|
-DBUILD_LAGOM=ON \
|
|
|
|
-DENABLE_LAGOM_CCACHE=ON \
|
2022-03-29 16:31:51 +02:00
|
|
|
-DENABLE_FUZZERS_LIBFUZZER=ON \
|
2021-08-17 11:50:23 -04:00
|
|
|
-DENABLE_ADDRESS_SANITIZER=ON \
|
|
|
|
-DCMAKE_C_COMPILER=clang \
|
|
|
|
-DCMAKE_CXX_COMPILER=clang++ \
|
2022-02-19 16:09:40 -07:00
|
|
|
-DCMAKE_PREFIX_PATH=tool-install
|
2021-08-17 11:50:23 -04:00
|
|
|
displayName: 'Create Build Environment'
|
2022-02-19 16:09:40 -07:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom
|
2021-09-21 06:42:35 -04:00
|
|
|
env:
|
|
|
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
2022-07-20 00:13:12 -06:00
|
|
|
- ${{ elseif eq(parameters.fuzzer, 'NoFuzz') }}:
|
2021-08-17 11:50:23 -04:00
|
|
|
- script: |
|
2023-03-19 13:17:36 -06:00
|
|
|
set -e
|
2022-02-19 16:09:40 -07:00
|
|
|
cmake -GNinja -B Build \
|
2021-08-17 11:50:23 -04:00
|
|
|
-DBUILD_LAGOM=ON \
|
|
|
|
-DENABLE_LAGOM_CCACHE=ON \
|
2022-12-23 11:39:09 -07:00
|
|
|
-DENABLE_LAGOM_LADYBIRD=ON \
|
2021-08-17 11:50:23 -04:00
|
|
|
-DINCLUDE_WASM_SPEC_TESTS=ON \
|
|
|
|
-DWASM_SPEC_TEST_SKIP_FORMATTING=ON \
|
|
|
|
-DENABLE_UNDEFINED_SANITIZER=ON \
|
|
|
|
-DENABLE_ADDRESS_SANITIZER=ON \
|
2022-12-23 11:39:09 -07:00
|
|
|
-DCMAKE_C_COMPILER=$(host-cc) \
|
|
|
|
-DCMAKE_CXX_COMPILER=$(host-cxx)
|
2021-08-17 11:50:23 -04:00
|
|
|
displayName: 'Create Build Environment'
|
2022-02-19 16:09:40 -07:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom
|
2021-08-17 11:50:23 -04:00
|
|
|
env:
|
|
|
|
PATH: '$(PATH):$(Build.SourcesDirectory)/wabt-1.0.23/bin'
|
2021-09-21 06:42:35 -04:00
|
|
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
2021-08-16 11:38:50 -04:00
|
|
|
|
2023-09-03 21:14:12 +02:00
|
|
|
- ${{ if not(eq(parameters.os, 'Android')) }}:
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cmake --build .
|
|
|
|
cmake --install . --prefix $(Build.SourcesDirectory)/Meta/Lagom/Install
|
|
|
|
displayName: 'Build'
|
|
|
|
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build
|
|
|
|
env:
|
|
|
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
2021-08-16 11:38:50 -04:00
|
|
|
|
2022-07-20 00:13:12 -06:00
|
|
|
- ${{ if and(eq(parameters.fuzzer, 'NoFuzz'), not(eq(parameters.os, 'Android')) ) }}:
|
2021-08-17 11:50:23 -04:00
|
|
|
- script: |
|
2023-03-19 13:17:36 -06:00
|
|
|
set -e
|
2022-01-14 09:37:34 -05:00
|
|
|
ninja test
|
2021-08-17 11:50:23 -04:00
|
|
|
displayName: 'Test'
|
|
|
|
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build
|
|
|
|
env:
|
|
|
|
SERENITY_SOURCE_DIR: '$(Build.SourcesDirectory)'
|
|
|
|
CTEST_OUTPUT_ON_FAILURE: 1
|
2023-06-30 20:53:34 -06:00
|
|
|
ASAN_OPTIONS: 'strict_string_checks=1:check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=1'
|
2021-08-17 11:50:23 -04:00
|
|
|
UBSAN_OPTIONS: 'print_stacktrace=1:print_summary=1:halt_on_error=1'
|
2023-07-26 16:12:11 -04:00
|
|
|
TESTS_ONLY: 1
|
2021-08-16 19:02:27 -04:00
|
|
|
|
2023-06-13 17:30:16 +03:00
|
|
|
- ${{ if and(eq(parameters.fuzzer, 'NoFuzz'), eq(parameters.os, 'Linux') ) }}:
|
|
|
|
- script: |
|
|
|
|
./run.sh
|
|
|
|
displayName: 'WPT'
|
|
|
|
workingDirectory: $(Build.SourcesDirectory)/Tests/LibWeb/WPT/
|
|
|
|
env:
|
|
|
|
SERENITY_SOURCE_DIR: '$(Build.SourcesDirectory)'
|
|
|
|
QT_QPA_PLATFORM: 'offscreen'
|
|
|
|
|
2021-10-04 21:32:31 +02:00
|
|
|
- ${{ if eq(parameters.lagom_lints, true) }}:
|
|
|
|
- script: |
|
2022-01-22 19:19:29 +02:00
|
|
|
set -e
|
2021-10-04 21:32:31 +02:00
|
|
|
./Meta/check-markdown.sh
|
2022-02-12 19:18:12 +02:00
|
|
|
./Meta/lint-gml-format.sh
|
2023-03-18 19:23:35 +04:00
|
|
|
git ls-files '*.ipc' | xargs ./Meta/Lagom/Build/bin/IPCMagicLinter
|
2021-11-01 17:20:54 +01:00
|
|
|
displayName: 'Run lints that require Lagom'
|
2021-10-04 21:32:31 +02:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)/
|
|
|
|
env:
|
2023-03-18 19:23:35 +04:00
|
|
|
MARKDOWN_CHECK_BINARY: ./Meta/Lagom/Build/bin/markdown-check
|
|
|
|
GML_FORMAT: ./Meta/Lagom/Build/bin/gml-format
|
2021-10-04 21:32:31 +02:00
|
|
|
# FIXME: enable detect_stack_use_after_return=1 #7420
|
2023-06-13 11:01:01 +02:00
|
|
|
ASAN_OPTIONS: 'strict_string_checks=1:check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=0'
|
2021-10-04 21:32:31 +02:00
|
|
|
UBSAN_OPTIONS: 'print_stacktrace=1:print_summary=1:halt_on_error=1'
|
|
|
|
|
2021-08-16 19:02:27 -04:00
|
|
|
- script: |
|
2021-09-21 06:42:35 -04:00
|
|
|
CCACHE_DIR='$(SERENITY_CCACHE_DIR)' ccache -s
|
2021-08-16 19:02:27 -04:00
|
|
|
displayName: 'Cache Stats'
|