CI: Move running LibWeb layout tests to Azure

The current config on GitHub Actions does not use ccache, so it takes
quite a while to build. Instead, let's just run these tests on Azure
where we already build Ladybird and have ccache enabled. This also lets
us sanitize LibWeb on both Linux and macOS.

The script changes here are to A) handle differences between Azure and
GitHub Actions and B) to support running on macOS.
This commit is contained in:
Timothy Flynn 2023-01-30 15:07:07 -05:00 committed by Linus Groh
parent 093e7e2a86
commit 9f9b8e7273
Notes: sideshowbarker 2024-07-17 00:57:24 +09:00
3 changed files with 33 additions and 69 deletions

View file

@ -1,57 +0,0 @@
name: Test LibWeb layout
on: [ push, pull_request ]
env:
SERENITY_SOURCE_DIR: ${{ github.workspace }}
concurrency: libweb-layout
jobs:
build:
runs-on: ubuntu-22.04
if: github.repository == 'SerenityOS/serenity'
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: "Install Ubuntu dependencies"
run: |
sudo apt-get update
sudo apt-get install -y ninja-build gcc-12 g++-12 libstdc++-12-dev \
libgl1-mesa-dev qt6-base-dev qt6-tools-dev-tools \
- name: "Create build directories"
run: |
mkdir -p ${{ github.workspace }}/Build/caches/TZDB
mkdir -p ${{ github.workspace }}/Build/caches/UCD
mkdir -p ${{ github.workspace }}/Build/caches/CLDR
- name: "TimeZoneData cache"
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with:
path: ${{ github.workspace }}/Build/caches/TZDB
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
- name: "UnicodeData cache"
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with:
path: ${{ github.workspace }}/Build/caches/UCD
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
- name: "UnicodeLocale cache"
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with:
path: ${{ github.workspace }}/Build/caches/CLDR
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}
- name: "Create Ladybird build environment"
run: |
cmake -GNinja \
-B ${{ github.workspace }}/Build/ladybird \
-S ${{ github.workspace }}/Ladybird \
-DCMAKE_C_COMPILER=gcc-12 \
-DCMAKE_CXX_COMPILER=g++-12 \
-DSERENITY_CACHE_DIR=${{ github.workspace }}/Build/cachess
- name: "Build Ladybird"
run: |
ninja -C ${{ github.workspace }}/Build/ladybird
- name: "Run layout tests"
run: |
${{ github.workspace }}/Tests/LibWeb/Layout/layout_test.sh
env:
QT_QPA_PLATFORM: "offscreen"

View file

@ -146,6 +146,16 @@ jobs:
ASAN_OPTIONS: 'strict_string_checks=1:check_initialization_order=1:strict_init_order=1'
UBSAN_OPTIONS: 'print_stacktrace=1:print_summary=1:halt_on_error=1'
- script: |
$(Build.SourcesDirectory)/Tests/LibWeb/Layout/layout_test.sh "$(Build.SourcesDirectory)/Meta/Lagom/Build/Ladybird"
displayName: 'LibWeb Layout Tests'
env:
SERENITY_SOURCE_DIR: '$(Build.SourcesDirectory)'
QT_QPA_PLATFORM: 'offscreen'
# FIXME: enable detect_stack_use_after_return=1 #7420
ASAN_OPTIONS: 'strict_string_checks=1:check_initialization_order=1:strict_init_order=1'
UBSAN_OPTIONS: 'print_stacktrace=1:print_summary=1:halt_on_error=1'
- ${{ if eq(parameters.lagom_lints, true) }}:
- script: |
set -e

View file

@ -2,19 +2,30 @@
set -eo pipefail
SCRIPT_DIR="$(dirname "${0}")"
SERENITY_ROOT="$(realpath "${SCRIPT_DIR}"/../../..)"
LADYBIRD_BUILD_DIR="${SERENITY_ROOT}/Build/ladybird"
SCRIPT_DIR="$(cd -P -- "$(dirname -- "${0}")" && pwd -P)"
LADYBIRD_BUILD_DIR="${1}"
for filename in "$SCRIPT_DIR"/input/*; do
name=$(basename "$filename" .html)
input_html_path=$(realpath "$SCRIPT_DIR")/input/"$name".html
output_layout_dump=$(cd "$LADYBIRD_BUILD_DIR"; ./ladybird -d "$input_html_path")
expected_layout_dump_path="$(realpath "$SCRIPT_DIR")/expected/$name.txt"
if cmp <(echo "$output_layout_dump") "$expected_layout_dump_path"; then
echo "$name PASSED"
if [[ -z "${LADYBIRD_BUILD_DIR}" ]] ; then
echo "Provide path to the Ladybird build directory"
exit 1
fi
if [[ "$(uname -s)" = "Darwin" ]] ; then
LADYBIRD_BINARY="./ladybird.app/Contents/MacOS/ladybird"
else
LADYBIRD_BINARY="./ladybird"
fi
for input_html_path in "${SCRIPT_DIR}"/input/*; do
input_html_file="$(basename "${input_html_path}" .html)"
output_layout_dump=$(cd "${LADYBIRD_BUILD_DIR}"; "${LADYBIRD_BINARY}" -d "${input_html_path}")
expected_layout_dump_path="${SCRIPT_DIR}/expected/${input_html_file}.txt"
if cmp <(echo "${output_layout_dump}") "${expected_layout_dump_path}"; then
echo "${input_html_file} PASSED"
else
echo "$name FAILED"
diff "$expected_layout_dump_path" <(echo "$output_layout_dump")
echo "${input_html_file} FAILED"
diff "${expected_layout_dump_path}" <(echo "${output_layout_dump}")
fi
done