Files
llvm-mingw/.github/workflows/test-llvm.yml
T
Martin Storsjö 0abb154828 github: Don't add the bundled Python to PATH in test-llvm
Previously, we added the llvm-mingw bundled python to the head
of PATH, but we didn't expect to use it after all.

(In other tests, where we explicitly want to use the llvm-mingw
bundled python, we set -DPython3_EXECUTABLE="$Env:PYTHON_EXE.)

Previously (with runner image version 20260622.87.1), CMake ended
up choosing
C:/hostedtoolcache/windows/Python/3.13.14/x64/python3.exe, but
now (with runner image version 20260629.93.2) we ended up picking
C:/llvm-mingw/python/bin/python3.14.exe instead.

With the newer runner images, we do have
C:\hostedtoolcache\windows\Python\3.13.14\arm64\python3.exe in
PATH, but it is unclear why that doesn't get picked.

(Picking another version than the first one in PATH would make
sense if we'd have Python_FIND_STRATEGY=VERSION set. According to
the docs, that shouldn't be the default any longer though, and it
wouldn't explain why it picked 3.13 before when we provide
3.14.)

In any case, just skip adding our version to PATH since we
don't intend to use it, to make it use the system provided
version.
2026-07-05 23:20:24 +03:00

100 lines
3.4 KiB
YAML

name: Run LLVM tests
on:
workflow_dispatch:
inputs:
ref:
description: 'Ref to extract from'
type: string
default: 'master'
pipeline_type:
description: 'Pipeline type'
required: true
default: 'push'
type: choice
options:
- push
- schedule
schedule:
- cron: '30 13 * * 0' # 13:30 UTC on Sundays
jobs:
prepare:
if: (github.event_name != 'schedule') || (github.repository == 'mstorsjo/llvm-mingw')
runs-on: ubuntu-latest
outputs:
LLVM_VERSION: ${{steps.get-parameters.outputs.LLVM_VERSION}}
steps:
- name: Download build parameters
uses: dawidd6/action-download-artifact@v19
with:
workflow: build.yml
workflow_conclusion: success
ref: ${{github.event_name == 'workflow_dispatch' && inputs.ref || 'master'}}
event: ${{github.event_name == 'workflow_dispatch' && inputs.pipeline_type || 'schedule'}}
name: parameters
- name: Get build parameters
id: get-parameters
run: |
cat parameters.txt >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
test-llvm:
needs: [prepare]
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64
runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}}
steps:
- name: Download toolchain
uses: dawidd6/action-download-artifact@v19
with:
workflow: build.yml
workflow_conclusion: success
ref: ${{github.event_name == 'workflow_dispatch' && inputs.ref || 'master'}}
event: ${{github.event_name == 'workflow_dispatch' && inputs.pipeline_type || 'schedule'}}
name: windows-ucrt-${{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
- uses: actions/checkout@v6
- name: Checkout llvm-project
env:
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}}
run: |
git config --global core.autocrlf false
bash -c "CHECKOUT_ONLY=1 ./build-llvm.sh"
# Not passing -DPython3_EXECUTABLE="$Env:PYTHON_EXE" here. The bundled Python doesn't normally have
# zlib enabled, which some tests require.
- name: Build the project and unittests
run: |
cd llvm-project
mkdir build
cd build
cmake ../llvm `
-G Ninja `
-DCMAKE_BUILD_TYPE=Release `
-DLLVM_HOST_TRIPLE=${{matrix.arch}}-w64-windows-gnu `
-DCMAKE_SYSTEM_PROCESSOR=${{matrix.arch}} `
-DCMAKE_SYSTEM_NAME=Windows `
-DLLVM_TARGETS_TO_BUILD="AArch64;X86" `
-DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" `
-DLLVM_WINDOWS_PREFER_FORWARD_SLASH=OFF `
-DCMAKE_C_COMPILER=clang `
-DCMAKE_CXX_COMPILER=clang++ `
-DCMAKE_CXX_FLAGS="-D__USE_MINGW_ANSI_STDIO=${{startsWith(matrix.arch, 'a') && '0' || '1'}}" `
-DLLVM_LIT_ARGS="-v --time-tests"
ninja test-depends
cp c:\llvm-mingw\bin\libc++.dll bin
cp c:\llvm-mingw\bin\libunwind.dll bin
- name: Run tests
run: |
cd llvm-project
cd build
ninja check