Skip to content

.github/workflows/sycl-windows-build.yml #16

.github/workflows/sycl-windows-build.yml

.github/workflows/sycl-windows-build.yml #16

name: Reusable SYCL Windows build workflow
on:
workflow_call:
inputs:
build_cache_suffix:
type: string
required: false
default: "default"
build_configure_extra_args:
type: string
required: false
changes:
type: string
description: 'Filter matches for the changed files in the PR'
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
required: false
ref:
type: string
required: False
artifact_archive_name:
type: string
default: llvm_sycl.tar.gz
retention-days:
description: 'Artifacts retention period'
type: string
default: 3
compiler:
type: string
required: false
default: "cl"
outputs:
build_conclusion:
value: ${{ jobs.build.outputs.build_conclusion }}
artifact_archive_name:
value: ${{ inputs.artifact_archive_name }}
workflow_dispatch:
inputs:
changes:
description: 'Filter matches for the changed files in the PR'
type: choice
options:
- "[]"
- '[sycl]'
- '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
build_cache_suffix:
type: choice
options:
- "default"
build_configure_extra_args:
type: string
required: false
artifact_archive_name:
type: choice
options:
- 'llvm_sycl.tar.gz'
default:
retention-days:
type: choice
options:
- 3
compiler:
type: choice
options:
- cl
- icx
permissions: read-all
jobs:
build:
name: Build + LIT
runs-on: [Windows, build]
environment: WindowsCILock
outputs:
build_conclusion: ${{ steps.build.conclusion }}
steps:
- name: Detect hung tests
if: always()
shell: powershell
continue-on-error: true
run: |
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1"
powershell.exe -File windows_detect_hung_tests.ps1
$exitCode = $LASTEXITCODE
Remove-Item -Path "windows_detect_hung_tests.ps1"
exit $exitCode
- uses: actions/checkout@v4
with:
sparse-checkout: |
devops/actions
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: amd64
- name: Setup oneAPI env
uses: ./devops/actions/setup_windows_oneapi_env
if: ${{ always() && !cancelled() && inputs.compiler == 'icx' }}
- name: Set env
run: |
git config --system core.longpaths true
git config --global core.autocrlf false
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "CCACHE_DIR=D:\github\_work\cache\${{ inputs.build_cache_suffix }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CCACHE_MAXSIZE=10G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Register cleanup after job is finished
uses: ./devops/actions/cleanup
- uses: ./devops/actions/cached_checkout
with:
path: src
ref: ${{ inputs.ref || github.sha }}
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
- name: Configure
shell: cmd
env:
ARGS: ${{ inputs.build_configure_extra_args }}
# TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83
run: |
mkdir build
mkdir install
IF NOT EXIST D:\github\_work\cache MKDIR D:\github\_work\cache
IF NOT EXIST D:\github\_work\cache\${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
python.exe src/buildbot/configure.py -o build ^
--ci-defaults %ARGS% ^
--cmake-opt="-DCMAKE_C_COMPILER=${{inputs.compiler}}" ^
--cmake-opt="-DCMAKE_CXX_COMPILER=${{inputs.compiler}}" ^
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
--cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache" ^
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=ccache" ^
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" ^
--cmake-opt="-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV"
- name: Build
id: build
shell: bash
run: |
cmake --build build --target sycl-toolchain
- name: check-llvm
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
shell: bash
run: |
cmake --build build --target check-llvm
- name: check-clang
if: always() && !cancelled() && contains(inputs.changes, 'clang')
run: |
cmake --build build --target check-clang
- name: check-sycl
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
shell: bash
run: |
cmake --build build --target check-sycl
- name: check-sycl-unittests
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
run: |
cmake --build build --target check-sycl-unittests
- name: check-llvm-spirv
if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv')
run: |
cmake --build build --target check-llvm-spirv
- name: check-xptifw
if: always() && !cancelled() && contains(inputs.changes, 'xptifw')
run: |
cmake --build build --target check-xptifw
- name: check-libdevice
if: always() && !cancelled() && contains(inputs.changes, 'libdevice')
run: |
cmake --build build --target check-libdevice
- name: Generate/diff new ABI symbols
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
shell: bash
run: |
LLVM_BIN_PATH="build/bin" python.exe src/sycl/tools/abi_check.py --mode dump_symbols --output build/new_sycl_symbols_windows.dump build/bin/sycl?.dll
diff -Naur src/sycl/test/abi/sycl_symbols_windows.dump build/new_sycl_symbols_windows.dump || true
- name: Upload new ABI symbols
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
uses: actions/upload-artifact@v4
with:
name: sycl_windows_abi_symbols
path: build/new_sycl_symbols_windows.dump
retention-days: ${{ inputs.retention-days }}
- name: Install
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
shell: bash
# TODO replace utility installation with a single CMake target
run: |
cmake --build build --target deploy-sycl-toolchain
cmake --build build --target utils/FileCheck/install
cmake --build build --target utils/count/install
cmake --build build --target utils/not/install
cmake --build build --target utils/lit/install
cmake --build build --target utils/llvm-lit/install
cmake --build build --target install-llvm-size
cmake --build build --target install-llvm-cov
cmake --build build --target install-llvm-profdata
cmake --build build --target install-compiler-rt
- name: Pack toolchain
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
shell: bash
run: |
tar -czf ${{ inputs.artifact_archive_name }} -C install .
- name: Upload toolchain
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
uses: actions/upload-artifact@v4
with:
name: sycl_windows_default
path: ${{ inputs.artifact_archive_name }}
retention-days: ${{ inputs.retention-days }}
- name: Detect hung tests
if: always()
shell: powershell
run: |
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1"
powershell.exe -File windows_detect_hung_tests.ps1
$exitCode = $LASTEXITCODE
Remove-Item -Path "windows_detect_hung_tests.ps1"
exit $exitCode
#############################################################################
- name: Setup SYCL toolchain
run: |
echo "PATH=$env:GITHUB_WORKSPACE\\install\\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Configure E2E
shell: cmd
run: |
mkdir build-e2e
cmake -GNinja -B build-e2e -S"$env:GITHUB_WORKSPACE\src\sycl\test-e2e" -DCMAKE_CXX_COMPILER="clang++" -DLEVEL_ZERO_LIBS_DIR="D:\github\level-zero_win-sdk\lib" -DLEVEL_ZERO_INCLUDE="D:\github\level-zero_win-sdk\include" -DLLVM_LIT="$env:GITHUB_WORKSPACE\src\llvm\utils\lit\lit.py"
- name: Run End-to-End tests
shell: bash
run: |
# Run E2E tests.
export LIT_OPTS="-v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests --param test-mode=build-only"
cmake --build build-e2e --target check-sycl-e2e
- name: Detect hung tests
if: always()
shell: powershell
run: |
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1"
powershell.exe -File windows_detect_hung_tests.ps1
$exitCode = $LASTEXITCODE
Remove-Item -Path "windows_detect_hung_tests.ps1"
exit $exitCode
- name: Cleanup
shell: cmd
if: always()
run: |
rmdir /q /s install
rmdir /q /s build-e2e
#############################################################################