[libc++][CI] Add a Github workflow to test libc++ tools (#211067)
We have a few scripts under libcxx/utils, and they wouldn't be tested on a regular basis. As a result, changes to e.g. the build system could break these scripts, which in turn could break some Github workflows like the libc++ PR benchmarking workflow. This patch adds a new `test-tools` configuration to `run-buildbot` which allows testing these tools locally, and a new dedicated Github workflow to run it.
This commit is contained in:
parent
982688d57f
commit
8676929694
2 changed files with 85 additions and 0 deletions
54
.github/workflows/libcxx-pr-test-tools.yml
vendored
Normal file
54
.github/workflows/libcxx-pr-test-tools.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# This workflow exercises libc++ tools whose testing doesn't belong in the conformance
|
||||
# suite or in `check-cxx` proper.
|
||||
#
|
||||
# The actual logic lives in `libcxx/utils/ci/run-buildbot test-tools`, which is also how
|
||||
# failures can be reproduced locally (after installing libcxx/utils/requirements.txt):
|
||||
#
|
||||
# CC=clang CXX=clang++ libcxx/utils/ci/run-buildbot test-tools
|
||||
|
||||
name: "[libc++] Test tools"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'libcxx/**'
|
||||
- 'libcxxabi/**'
|
||||
- 'libunwind/**'
|
||||
- 'runtimes/**'
|
||||
- 'cmake/**'
|
||||
- '.github/workflows/libcxx-pr-test-tools.yml'
|
||||
schedule:
|
||||
# Match the main libc++ CI cron
|
||||
- cron: '0 8 * * *'
|
||||
|
||||
permissions:
|
||||
contents: read # Default everything to read-only
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test-tools:
|
||||
if: github.repository_owner == 'llvm'
|
||||
runs-on: llvm-premerge-libcxx-runners
|
||||
env:
|
||||
CC: clang-23
|
||||
CXX: clang++-23
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0 # some tools need full git history
|
||||
fetch-tags: true
|
||||
|
||||
- name: Set up Python dependencies
|
||||
run: |
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r libcxx/utils/requirements.txt
|
||||
|
||||
- name: Run the tooling smoke test
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
libcxx/utils/ci/run-buildbot test-tools
|
||||
|
|
@ -270,6 +270,37 @@ check-generated-output)
|
|||
--exclude 'underflow.pass.cpp' \
|
||||
|| false
|
||||
;;
|
||||
test-tools)
|
||||
#
|
||||
# This job tests libc++ tools that don't make sense to be tested inside the
|
||||
# libc++ conformance test suite.
|
||||
#
|
||||
clean
|
||||
|
||||
step "Building and installing libc++ with build-at-commit"
|
||||
"${MONOREPO_ROOT}/libcxx/utils/build-at-commit" \
|
||||
--git-repo "${MONOREPO_ROOT}" \
|
||||
--commit HEAD \
|
||||
--install-dir "${INSTALL_DIR}" \
|
||||
--tmp-build-dir "${BUILD_DIR}/build-at-commit" \
|
||||
-- -DCMAKE_CXX_COMPILER="${CXX}" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
|
||||
step "Running a benchmark through the benchmark tooling pipeline"
|
||||
"${MONOREPO_ROOT}/libcxx/utils/test-at-commit" \
|
||||
--git-repo "${MONOREPO_ROOT}" \
|
||||
--libcxx-installation "${INSTALL_DIR}" \
|
||||
--build-dir "${BUILD_DIR}/benchmarks" \
|
||||
--compiler "${CXX}" \
|
||||
-- -sv --param optimization=speed \
|
||||
"${MONOREPO_ROOT}/libcxx/test/benchmarks/hash.bench.cpp"
|
||||
|
||||
step "Consolidate benchmark results"
|
||||
"${MONOREPO_ROOT}/libcxx/utils/consolidate-benchmarks" "${BUILD_DIR}/benchmarks" > "${BUILD_DIR}/results.lnt"
|
||||
|
||||
step "Compare benchmark results" # perform a no-op comparison, just to run the tool
|
||||
"${MONOREPO_ROOT}/libcxx/utils/compare-benchmarks" "${BUILD_DIR}/results.lnt" "${BUILD_DIR}/results.lnt"
|
||||
;;
|
||||
#
|
||||
# Various Standard modes
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in a new issue