Skip to content

[Windows] Fix build issues using Clang-CL on Windows, add CI #432

[Windows] Fix build issues using Clang-CL on Windows, add CI

[Windows] Fix build issues using Clang-CL on Windows, add CI #432

Workflow file for this run

name: pull
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true
jobs:
unittest-linux:
name: unittest-linux
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
strategy:
fail-fast: false
with:
runner: linux.2xlarge
submodules: 'true'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
set -ex
cmake -DCMAKE_BUILD_TYPE=Debug test -Bbuild/test
cmake --build build/test -j9 --config Debug
pushd build/test && ctest && popd
# Install tokenizers
pip install . -v
pip install pytest blobfile transformers>=4.53.1
# Run tests
pytest
windows:
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
with:
runner: windows.4xlarge
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
script: |
conda init powershell
powershell -Command "& {
Set-PSDebug -Trace 1
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true
cmake -DCMAKE_BUILD_TYPE=Debug test -Bbuild/test -T ClangCL
cmake --build build/test -j9 --config Debug
if (\$LASTEXITCODE -ne 0) {
Write-Host "Build was not successful. Exit code: \$LASTEXITCODE."
exit \$LASTEXITCODE
}
Push-Location build/test
ctest
if (\$LASTEXITCODE -ne 0) {
Write-Host "Unit tests were not successful. Exit code: \$LASTEXITCODE."
exit \$LASTEXITCODE
}
Pop-Location
# Install tokenizers
pip install . -v
pip install pytest blobfile transformers>=4.53.1
# Run tests
pytest
if (\$LASTEXITCODE -ne 0) {
Write-Host "Python tests were not successful. Exit code: \$LASTEXITCODE."
exit \$LASTEXITCODE
}
}"