Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .ci/generate_test_report_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@
"""Script to generate a build report for Github."""

import argparse
import platform

import generate_test_report_lib

PLATFORM_TITLES = {
"Windows": ":window: Windows x64 Test Results",
"Linux": ":penguin: Linux x64 Test Results",
}

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"title", help="Title of the test report, without Markdown formatting."
)
parser.add_argument("return_code", help="The build's return code.", type=int)
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
args = parser.parse_args()

report = generate_test_report_lib.generate_report_from_files(
args.title, args.return_code, args.junit_files
PLATFORM_TITLES[platform.system], args.return_code, args.junit_files
)

print(report)
49 changes: 9 additions & 40 deletions .ci/monolithic-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,15 @@
# run only the relevant tests.
#

set -ex
set -o pipefail
source ./utils.sh

MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
INSTALL_DIR="${BUILD_DIR}/install"
rm -rf "${BUILD_DIR}"

sccache --zero-stats

mkdir -p artifacts/reproducers

# Make sure any clang reproducers will end up as artifacts.
# Make sure any clang reproducers will end up as artifactss
export CLANG_CRASH_DIAGNOSTICS_DIR=`realpath artifacts/reproducers`

function at-exit {
retcode=$?

sccache --show-stats > artifacts/sccache_stats.txt
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :

# If building fails there will be no results files.
shopt -s nullglob

python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":penguin: Linux x64 Test Results" \
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
}
trap at-exit EXIT

projects="${1}"
targets="${2}"
runtimes="${3}"
Expand All @@ -52,7 +31,7 @@ enable_cir="${6}"

lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"

echo "::group::cmake"
start-group "CMake"
export PIP_BREAK_SYSTEM_PACKAGES=1
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt

Expand Down Expand Up @@ -83,49 +62,39 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"

echo "::endgroup::"
echo "::group::ninja"
start-group "ninja"

# Targets are not escaped as they are passed as separate arguments.
ninja -C "${BUILD_DIR}" -k 0 ${targets}

echo "::endgroup::"

if [[ "${runtime_targets}" != "" ]]; then
echo "::group::ninja runtimes"
start-group "ninja Runtimes"

ninja -C "${BUILD_DIR}" ${runtime_targets}

echo "::endgroup::"
fi

# Compiling runtimes with just-built Clang and running their tests
# as an additional testing for Clang.
if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
echo "::group::cmake runtimes C++26"
start-group "CMake Runtimes C++26"

cmake \
-D LIBCXX_TEST_PARAMS="std=c++26" \
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
"${BUILD_DIR}"

echo "::endgroup::"
echo "::group::ninja runtimes C++26"
start-group "ninja Runtimes C++26"

ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}

echo "::endgroup::"
echo "::group::cmake runtimes clang modules"
start-group "CMake Runtimes Clang Modules"

cmake \
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
"${BUILD_DIR}"

echo "::endgroup::"
echo "::group::ninja runtimes clang modules"
start-group "ninja Runtimes Clang Modules"

ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}

echo "::endgroup::"
fi
32 changes: 3 additions & 29 deletions .ci/monolithic-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,12 @@
# run only the relevant tests.
#

set -ex
set -o pipefail

MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"

rm -rf "${BUILD_DIR}"

sccache --zero-stats
function at-exit {
retcode=$?

mkdir -p artifacts
sccache --show-stats >> artifacts/sccache_stats.txt
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :

# If building fails there will be no results files.
shopt -s nullglob

python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":window: Windows x64 Test Results" \
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
}
trap at-exit EXIT
source ./utils.sh

projects="${1}"
targets="${2}"

echo "::group::cmake"
start-group "CMake"
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt

export CC=cl
Expand Down Expand Up @@ -71,10 +48,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"

echo "::endgroup::"
echo "::group::ninja"
start-group "ninja"

# Targets are not escaped as they are passed as separate arguments.
ninja -C "${BUILD_DIR}" -k 0 ${targets}

echo "::endgroup"
51 changes: 51 additions & 0 deletions .ci/utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
#===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------------------------------------------------===##

# This script performs some setup and contains some utilities used for in the
# monolithic-linux.sh and monolithic-windows.sh scripts.

set -ex
set -o pipefail

MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"

rm -rf "${BUILD_DIR}"

sccache --zero-stats

function at-exit {
retcode=$?

mkdir -p artifacts
sccache --show-stats >> artifacts/sccache_stats.txt
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :

# If building fails there will be no results files.
shopt -s nullglob

if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
fi
}
trap at-exit EXIT

function start-group {
groupname=$1
if [[ "$GITHUB_ACTIONS" != "" ]]; then
echo "::endgroup"
echo "::group::$groupname"
elif [[ "$POSTCOMMIT_CI" != "" ]]; then
echo "@@@$STEP@@@"
else
echo "Starting $groupname"
fi
}
Loading