blob: 2906b399307f2520312a50c568a12d9111328fd4 [file] [log] [blame]
# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: CI - Windows x64 MSVC
on:
workflow_call:
workflow_dispatch:
jobs:
windows_x64_msvc:
runs-on: azure-windows-scale
env:
BASE_BUILD_DIR_POWERSHELL: B:\tmpbuild
SCCACHE_AZURE_CONNECTION_STRING: "${{ secrets.AZURE_CCACHE_CONNECTION_STRING }}"
SCCACHE_AZURE_BLOB_CONTAINER: ccache-container
SCCACHE_CCACHE_ZSTD_LEVEL: 10
SCCACHE_AZURE_KEY_PREFIX: "ci_windows_x64_msvc"
steps:
- name: "Checking out repository"
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
# TODO(#18813): Remove this. Environment setup needs to happen on runners, not in workflows.
- name: "Create build dir"
run: |
$buildDir = "$env:BASE_BUILD_DIR_POWERSHELL\"
echo "BUILD_DIR_POWERSHELL=$buildDir" >> $env:GITHUB_ENV
mkdir "$buildDir"
Write-Host "Generated Build Directory: $buildDir"
$bashBuildDir = $buildDir -replace '\\', '/' -replace '^B:', '/b'
echo "BUILD_DIR_BASH=$bashBuildDir" >> $env:GITHUB_ENV
Write-Host "Converted Build Directory For Bash: $bashBuildDir"
- name: "Setting up Python"
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: "3.11"
- name: "Installing Python packages"
run: |
python3 -m venv .venv
.venv/Scripts/activate.bat
python3 -m pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt
# TODO(#18813): Fix to actually use either ccache or sccache.
# No need to install both, and neither is currently used.
- name: "Installing requirements"
run: choco install ccache --yes
- name: "Configuring MSVC"
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: "Installing IREE requirements"
run: |
choco install sccache
choco install cmake
# ninja pinned due to a bug in the 1.13.0 release:
# https://github.com/ninja-build/ninja/issues/2616
choco install ninja --version 1.12.1
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv
- name: "Building IREE"
run: |
echo "Building in ${{ env.BUILD_DIR_BASH }}"
bash ./build_tools/cmake/build_all.sh ${{ env.BUILD_DIR_BASH }}
- name: "Testing IREE"
run: bash ./build_tools/cmake/ctest_all.sh ${{ env.BUILD_DIR_BASH }}
- name: "Clean up build dir"
if: always()
run: if (Test-Path -Path "$Env:BUILD_DIR_POWERSHELL") {Remove-Item -Path "$Env:BUILD_DIR_POWERSHELL" -Recurse -Force}
# Alerting on failure is the responsibility of the calling job.