Skip to content

Commit fc9b02d

Browse files
committed
Get llvm version through lit
1 parent b44fbb2 commit fc9b02d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,13 @@ jobs:
13301330
python-version: ${{ inputs.python_version }}
13311331
architecture: x64 # FIXME(#1004): Remove workaround installing x64 Python on ARM64 CI hosts
13321332

1333+
- name: Get lit version
1334+
id: get-llvm-version
1335+
run: |
1336+
$litOutput = python ${{ github.workspace }}/SourceCache/llvm-project/llvm/utils/lit/lit.py --version
1337+
$litVersion = ($litOutput | Select-String -Pattern 'lit (\d+)' | ForEach-Object { $_.Matches[0].Groups[1].Value })
1338+
echo "llvm-version=$litVersion" >> $env:GITHUB_OUTPUT
1339+
13331340
- name: Configure LLVM
13341341
if: matrix.os != 'Android' || inputs.build_android
13351342
uses: ./SourceCache/ci-build/.github/actions/configure-cmake-project
@@ -1373,7 +1380,7 @@ jobs:
13731380
android-api-level: ${{ inputs.ANDROID_API_LEVEL }}
13741381
android-clang-version: ${{ inputs.ANDROID_CLANG_VERSION }}
13751382
ndk-path: ${{ steps.setup-ndk.outputs.ndk-path }}
1376-
install-dir: ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/lib/clang/21
1383+
install-dir: ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/lib/clang/${{ steps.get-llvm-version.outputs.llvm-version }}
13771384
built-compilers: '@("ASM", "C", "CXX")'
13781385
cmake-defines: |
13791386
@{
@@ -1402,7 +1409,7 @@ jobs:
14021409
android-api-level: ${{ inputs.ANDROID_API_LEVEL }}
14031410
android-clang-version: ${{ inputs.ANDROID_CLANG_VERSION }}
14041411
ndk-path: ${{ steps.setup-ndk.outputs.ndk-path }}
1405-
install-dir: ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/lib/clang/21
1412+
install-dir: ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/lib/clang/${{ steps.get-llvm-version.outputs.llvm-version }}
14061413
built-compilers: '@("ASM", "C", "CXX")'
14071414
cmake-defines: |
14081415
@{

0 commit comments

Comments
 (0)