github: Add setup for running libcxx's tests on the built toolchain

Keep this disabled by default (since it takes a fair amount of time
and has good test coverage upstream), but including it in disabled
form so that it's easy to enable temporarily for testing occasionally.

Libcxx does test the mingw configuration in their own CI (with an older
pinned release of the compiler), so this is mostly redundant, and
primarily relevant for testing that the very latest compiler (and
python setup) works for the tests.
This commit is contained in:
Martin Storsjö committed 2023-01-29 01:13:39 +02:00
1 parent dfd4c31f2e
commit c49460aa86
1 file changed
+66
+66
View File
@@ -268,6 +268,72 @@ jobs:
./run-tests.sh /llvm-mingw
./run-lldb-tests.sh /llvm-mingw
# Run libcxx's tests with the cross-built i686/x86_64 toolchains from above.
# (This builds its own copy of libcxx, but it should be pretty much
# identical to the one shipped - and tests that the toolchain works
# for running the libcxx tests.)
# This also forces testing the bundled python executables.
test-libcxx:
# This test is kinda slow, and kinda redundant (libcxx does contain
# llvm-mingw configurations in its own CI, so the only difference with
# testing here is different runners with different OS setups, and
# testing with the latest compiler instead of an older release).
# Therefore, keep the test disabled by default; it's easy to enable
# temporarily on a branch for testing.
if: false
needs: [linux-cross]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- i686
steps:
- uses: actions/download-artifact@v3
with:
name: windows-${{matrix.arch}}-toolchain
- name: Unpack toolchain
run: |
Expand-Archive llvm-mingw-*.zip -DestinationPath .
del llvm-mingw-*.zip
mv llvm-mingw-* c:\llvm-mingw
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
echo "c:\llvm-mingw\python\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
echo "PYTHON_EXE=c:/llvm-mingw/python/bin/python3.exe" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Fetch version
if: github.event_name == 'schedule'
run: |
cat c:\llvm-mingw\versions | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- uses: actions/checkout@v3
- name: Checkout llvm-project
run: |
bash -c "CHECKOUT_ONLY=1 ./build-llvm.sh"
- name: Build and test libcxx
run: |
cd llvm-project
mkdir build
cd build
cmake ../runtimes `
-G Ninja `
-DCMAKE_BUILD_TYPE=Release `
-DPython3_EXECUTABLE="$Env:PYTHON_EXE" `
-DLIBCXX_ENABLE_WERROR=YES `
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" `
-DLIBCXX_CXX_ABI=libcxxabi `
-DCMAKE_C_COMPILER=clang `
-DCMAKE_CXX_COMPILER=clang++ `
-DLIBCXX_TARGET_INFO="libcxx.test.target_info.MingwLocalTI" `
-DLIBCXXABI_ENABLE_SHARED=NO `
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES `
-DLIBCXX_USE_COMPILER_RT=YES `
-DLIBCXXABI_USE_COMPILER_RT=YES `
-DLIBUNWIND_USE_COMPILER_RT=YES `
-DLIBCXXABI_USE_LLVM_UNWINDER=YES `
-DLIBCXX_EXTRA_SITE_DEFINES="__USE_MINGW_ANSI_STDIO=1;TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT"
ninja
ninja check-cxx
# Run the OpenMP tests with the cross-built i686/x86_64 toolchains from above.
# This also forces testing the bundled python executables.
test-openmp: