diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml new file mode 100644 index 0000000000000..b1e09e7d17f9e --- /dev/null +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -0,0 +1,63 @@ +name: 'Locate vcvarsall and Setup Environment' +description: 'Locates vcvarsall.bat, sets up the environment, and handles PATH updates.' +inputs: + architecture: + description: 'Target architecture (x64 or x86)' + required: true + default: 'x64' +outputs: + vcvarsall_path: + description: "Path to vcvarsall.bat" + value: ${{ steps.find-vcvarsall.outputs.vcvarsall_path }} +runs: + using: "composite" + steps: + - name: Find vcvarsall.bat + id: find-vcvarsall + shell: python # Use Python shell + run: | + import os + import subprocess + + vswhere_path = os.path.join(os.environ["ProgramFiles(x86)"], "Microsoft Visual Studio", "Installer", "vswhere.exe") + + try: + process = subprocess.run([vswhere_path, "-latest", "-property", "installationPath"], capture_output=True, text=True, check=True) + vs_install_path = process.stdout.strip() + vcvarsall_path = os.path.join(vs_install_path, "VC", "Auxiliary", "Build", "vcvarsall.bat") + + if os.path.exists(vcvarsall_path): + print(f"vcvarsall found at: {vcvarsall_path}") + # Use GITHUB_OUTPUT environment variable + with open(os.environ['GITHUB_OUTPUT'], 'a') as f: + f.write(f"vcvarsall_path={vcvarsall_path}\n") + else: + print(f"vcvarsall.bat not found at expected path: {vcvarsall_path}") + # Use 'exit(1)' for Python to properly signal failure to GitHub Actions + exit(1) + + + except subprocess.CalledProcessError as e: + print(f"Error running vswhere.exe: {e}") + print(f"vswhere output: {e.stdout}") + print(f"vswhere stderr: {e.stderr}") + exit(1) # Exit with a non-zero code on error + except FileNotFoundError: + print(f"vswhere.exe not found at: {vswhere_path}") + exit(1) + + + - name: Setup Environment + shell: cmd + run: | + REM Get initial environment variables + set > initial_env.txt + + REM Call vcvarsall.bat using the output from the previous step + call "${{ steps.find-vcvarsall.outputs.vcvarsall_path }}" ${{ inputs.architecture }} + + REM Get environment variables after calling vcvarsall.bat + set > final_env.txt + + REM Call the Python script to update the GitHub Actions environment + python ${{ github.action_path }}\update_environment.py \ No newline at end of file diff --git a/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat new file mode 100644 index 0000000000000..df900e5cd0995 --- /dev/null +++ b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat @@ -0,0 +1,30 @@ +@echo off +setlocal + +set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +set vcvarsall_arch=%1 +if "%vcvarsall_arch%" == "x86" ( + set vcvarsall_arch=x86 +) else ( + set vcvarsall_arch=x64 +) + +for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do ( + if exist "%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" ( + set "vcvarsall=%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" + ) +) + +echo "Get initial environment variables" +set > initial_env.txt + +echo "Call vcvarsall.bat" +call "%vcvarsall%" + +echo "Get environment variables after calling vcvarsall.bat" +set > final_env.txt + +echo "Call the Python script to update the GitHub Actions environment" +python "%~dp0\update_environment.py" + +endlocal \ No newline at end of file diff --git a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py new file mode 100644 index 0000000000000..9b63b26042562 --- /dev/null +++ b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py @@ -0,0 +1,37 @@ +import os +import re + + +def read_env_file(filepath): + env_vars = {} + with open(filepath) as f: + for line in f: + match = re.match(r"^(.*?)=(.*)$", line.strip()) + if match: + env_vars[match.group(1).upper()] = match.group(2) + return env_vars + + +initial_env = read_env_file("initial_env.txt") +final_env = read_env_file("final_env.txt") + +for key, value in final_env.items(): + if key not in initial_env or initial_env[key] != value: + if key.startswith("_"): + continue + if key.upper() == "PATH": + new_paths = value.split(";") + initial_paths = initial_env.get("PATH", "").split(";") + added_paths = [p for p in new_paths if p not in initial_paths and p] + + if added_paths: + print("Adding paths") + with open(os.environ["GITHUB_PATH"], "a") as f: + for path in added_paths: + print(f"Adding PATH: {path}") + f.write(path + os.linesep) + else: + # Use GITHUB_ENV + with open(os.environ["GITHUB_ENV"], "a") as f: + print(f"Setting {key}={value}\n") + f.write(f"{key}={value}\n") diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml new file mode 100644 index 0000000000000..b4cb0adc47b66 --- /dev/null +++ b/.github/workflows/ios.yml @@ -0,0 +1,59 @@ +name: iOS_CI_on_Mac + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + iOS_CI_on_Mac: + runs-on: macos-13 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + - name: Use Xcode ${{ env.XCODE_VERSION }} + shell: bash + run: | + set -e -x + XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer" + sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: (CPU, CoreML, XNNPACK EPs) Build onnxruntime for iOS x86_64 and run tests using simulator + shell: bash + run: | + python3 ${{ github.workspace }}/tools/ci_build/build.py \ + --skip_submodule_sync \ + --build_dir ${{ github.workspace }}/iOS \ + --build_shared_lib \ + --use_coreml \ + --use_xnnpack \ + --ios \ + --apple_sysroot iphonesimulator \ + --osx_arch x86_64 \ + --apple_deploy_target=15.1 \ + --use_xcode \ + --config RelWithDebInfo \ + --build_apple_framework \ + --parallel \ + --use_binskim_compliant_compile_flags + env: + ORT_GET_SIMULATOR_DEVICE_INFO_REQUESTED_RUNTIME_VERSION: ${{ env.IOS_SIMULATOR_RUNTIME_VERSION }} + + timeout-minutes: 150 + env: + XCODE_VERSION: 14.3.1 + IOS_SIMULATOR_RUNTIME_VERSION: 16.4 \ No newline at end of file diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 3218afe11edfd..eb4befaa34244 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -1,4 +1,4 @@ -name: Mac_CI +name: "MacOS CI Pipeline" on: push: @@ -19,6 +19,100 @@ env: python_version: 3.11 jobs: + MacOS_C_API_Packaging_CPU_x86_64: + runs-on: macos-13 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Use Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.python_version }} + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Java 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: Set version number variables for Unix + shell: bash + run: | + # Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote. + set +x + + _OnnxRuntimeVersion=$(head -1 ${{ github.workspace }}/VERSION_NUMBER) + echo "OnnxRuntimeVersion=$_OnnxRuntimeVersion" + + _OnnxRuntimeGitCommitHash=$(git rev-parse HEAD) + echo "OnnxRuntimeGitCommitHash=$_OnnxRuntimeGitCommitHash" + + _OnnxRuntimeGitCommitHash=$(git rev-parse --short=8 HEAD) + echo "OnnxRuntimeGitCommitHashShort=$_OnnxRuntimeGitCommitHash" + working-directory: ${{ github.workspace }} + + - name: Use Xcode 14.3.1 + shell: bash + run: | + set -e -x + XCODE_DEVELOPER_DIR="/Applications/Xcode_14.3.1.app/Contents/Developer" + sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" + + - name: Setup environment variables + shell: bash + run: | + set -e -x + export PATH=${{ github.workspace }}/installed/bin:$PATH + export ONNX_ML=1 + export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_WERROR=OFF" + python3 -m pip install -r '${{ github.workspace }}/tools/ci_build/github/linux/docker/scripts/requirements.txt' + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Configure Build (build.py --update) + shell: bash + run: | + set -e -x + rm -rf ${{ github.workspace }}/Release + python3 ${{ github.workspace }}/tools/ci_build/build.py --update --build_objc --build_wheel --use_xnnpack --build_nodejs --build_java --use_coreml --use_webgpu --build_dir ${{ github.workspace }} --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags --build_shared_lib --config Release --use_vcpkg --use_vcpkg_ms_internal_asset_cache + + - name: Build (build.py --build) + shell: bash + run: | + set -e -x + python3 ${{ github.workspace }}/tools/ci_build/build.py --build --build_objc --build_wheel --use_xnnpack --build_nodejs --build_java --use_coreml --use_webgpu --build_dir ${{ github.workspace }} --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags --build_shared_lib --config Release --use_vcpkg --use_vcpkg_ms_internal_asset_cache + + - name: Install + shell: bash + run: | + set -e -x + cd ${{ github.workspace }}/Release + make install DESTDIR=${{ github.workspace }}/installed + + - name: Running Tests (build.py --test) + shell: bash + run: | + set -e -x + python3 ${{ github.workspace }}/tools/ci_build/build.py --test --build_objc --build_wheel --use_xnnpack --build_nodejs --build_java --use_coreml --use_webgpu --build_dir ${{ github.workspace }} --skip_submodule_sync --parallel --use_binskim_compliant_compile_flags --build_shared_lib --config Release --use_vcpkg --use_vcpkg_ms_internal_asset_cache + timeout-minutes: 300 + env: + MACOSX_DEPLOYMENT_TARGET: '13.3' + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + ARM64-Xcode16: runs-on: macos-15 diff --git a/.github/workflows/macos_coreml.yml b/.github/workflows/macos_coreml.yml new file mode 100644 index 0000000000000..42b9ec702661b --- /dev/null +++ b/.github/workflows/macos_coreml.yml @@ -0,0 +1,51 @@ +name: "CoreML CI Pipeline" + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_with_coreml: + runs-on: macos-13 + strategy: + matrix: + use_coreml: [true, false] + + env: + MACOSX_DEPLOYMENT_TARGET: '13.3' + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install coreutils and ninja + run: brew install coreutils ninja + + - name: Use Xcode 14.3.1 + run: | + XCODE_DEVELOPER_DIR="/Applications/Xcode_14.3.1.app/Contents/Developer" + sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: CoreML EP, Build and Test on macOS + run: | + python3 tools/ci_build/build.py \ + --build_dir build \ + --skip_submodule_sync \ + --cmake_generator=Ninja \ + --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags \ + --build_shared_lib \ + --config Debug \ + ${{ matrix.use_coreml && '--use_coreml' || '' }} \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 593ca85e8ea4b..0000000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Windows_CI -on: - push: - branches: - - main - - rel-* - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - AZCOPY_AUTO_LOGIN_TYPE: MSI - AZCOPY_MSI_CLIENT_ID: 63b63039-6328-442f-954b-5a64d124e5b4 - -jobs: - Windows-CUDA-12: - runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] - steps: - - uses: actions/checkout@v4 - with: - submodules: false - - uses: actions/setup-python@v5 - with: - python-version: '3.11.x' - architecture: 'x64' - - - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Download cuda - run: azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v12.2" cuda_sdk - - - - name: Delete build folder - run: | - if (Test-Path D:\b) { Remove-Item -Recurse -Force D:\b } - - - # The build machine doesn't have a GPU. So the value of CMAKE_CUDA_ARCHITECTURES doesn't matter. - - name: Build code - run: python tools\ci_build\build.py --windows_sdk_version 10.0.22621.0 --enable_training --build_java --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_pybind --use_cuda --cuda_home=${{ github.workspace }}\cuda_sdk\v12.2 --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75 \ No newline at end of file diff --git a/.github/workflows/windows_build_x64_asan.yml b/.github/workflows/windows_build_x64_asan.yml new file mode 100644 index 0000000000000..6be647c86eab8 --- /dev/null +++ b/.github/workflows/windows_build_x64_asan.yml @@ -0,0 +1,49 @@ +# .github/workflows/build_x64_asan.yml +name: windows_x64_asan + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env # Use the composite action + with: + architecture: x64 + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test (Combined) + shell: cmd + run: | + @echo off + echo %PATH% + python -m pip install -r "%GITHUB_WORKSPACE%\tools\ci_build/github/windows\python\requirements.txt" + python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%RUNNER_TEMP%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer \ No newline at end of file diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml new file mode 100644 index 0000000000000..081f8dc57a107 --- /dev/null +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -0,0 +1,129 @@ +name: windows_x64_debug + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_debug: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env # Use the composite action + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\Debug\Debug + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 # Use the official NuGet setup action + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\Debug -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config Debug --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_java --build_nodejs --build_wheel --disable_memleak_checker --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\Debug" -Include "*.obj" -Recurse + env: # Set environment variables here, applies to this step only + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' # Can be set dynamically based on build output if needed + + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\\build\\Debug\\Debug" + + # Publish artifacts only on failure and if DocUpdateNeeded is true (example) + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' # Use env. for step-level vars + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + # These variables will persist for the entire job + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' \ No newline at end of file diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml new file mode 100644 index 0000000000000..9f8f650e906dc --- /dev/null +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -0,0 +1,126 @@ +name: windows_x64_release + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" + + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml new file mode 100644 index 0000000000000..9c280da27e8bc --- /dev/null +++ b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml @@ -0,0 +1,117 @@ +name: windows_x64_release_ep_generic_interface + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release_ep_generic_interface: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --update --build --enable_generic_interface --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\\csharp + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml new file mode 100644 index 0000000000000..ec4ccef5390d2 --- /dev/null +++ b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml @@ -0,0 +1,113 @@ +name: windows_x64_release_vitisai + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release_vitisai: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --update --build --build_wheel --use_vitisai --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml new file mode 100644 index 0000000000000..13e830505513d --- /dev/null +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -0,0 +1,119 @@ +name: windows_x64_release_xnnpack + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release_xnnpack: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --use_xnnpack --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --disable_rtti --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\\csharp + + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml new file mode 100644 index 0000000000000..20f1bcd54cb1a --- /dev/null +++ b/.github/workflows/windows_x86.yml @@ -0,0 +1,127 @@ +name: Windows CPU CI Pipeline + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x86_release: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x86 # x86 Python + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x86 # x86 architecture for vcvarsall + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + architecture: x86 #Add architecture + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x86 # x86 Java + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x86 # x86 .NET + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" + + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v4 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' \ No newline at end of file diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index c20ea159943fe..e6c3d9faf4a3f 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1069,6 +1069,10 @@ def generate_vcpkg_install_options(build_dir, args): if "AGENT_TEMPDIRECTORY" in os.environ: temp_dir = os.environ["AGENT_TEMPDIRECTORY"] vcpkg_install_options.append(f"--x-buildtrees-root={temp_dir}") + elif "RUNNER_TEMP" in os.environ: + temp_dir = os.environ["RUNNER_TEMP"] + vcpkg_install_options.append(f"--x-buildtrees-root={temp_dir}") + vcpkg_install_options.append("--binarysource=clear\\;x-gha,readwrite") # Config asset cache if args.use_vcpkg_ms_internal_asset_cache: diff --git a/tools/ci_build/github/azure-pipelines/mac-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-ci-pipeline.yml deleted file mode 100644 index f3465a8eea8b5..0000000000000 --- a/tools/ci_build/github/azure-pipelines/mac-ci-pipeline.yml +++ /dev/null @@ -1,37 +0,0 @@ -##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### -### please do rerun set-trigger-rules.py ### -trigger: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -pr: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -#### end trigger #### - -stages: -- template: templates/mac-cpu-packaging-pipeline.yml - parameters: - AllowReleasedOpsetOnly: 0 - BuildForAllArchs: false - AdditionalBuildFlags: --build_objc --build_wheel --use_xnnpack - WithCache: true diff --git a/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml deleted file mode 100644 index 42f5340730a69..0000000000000 --- a/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml +++ /dev/null @@ -1,68 +0,0 @@ -##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### -### please do rerun set-trigger-rules.py ### -trigger: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -pr: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -#### end trigger #### - -jobs: -- job: CoreML_CI - workspace: - clean: all - pool: - vmImage: 'macOS-13' - variables: - MACOSX_DEPLOYMENT_TARGET: '13.3' - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - CCACHE_DIR: '$(Pipeline.Workspace)/ccache' - timeoutInMinutes: 120 - steps: - - script: brew install coreutils ninja - displayName: Install coreutils and ninja - - - template: templates/use-xcode-version.yml - - - template: templates/mac-build-step-with-cache.yml - parameters: - WithCache: true - Today: $(TODAY) - AdditionalKey: coreml - CacheDir: $(CCACHE_DIR) - BuildStep: - - script: | - set -e - python3 tools/ci_build/build.py \ - --build_dir build \ - --skip_submodule_sync \ - --cmake_generator=Ninja \ - --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags \ - --build_shared_lib \ - --config Debug \ - --use_cache \ - --use_coreml - displayName: CoreML EP, Build and Test on macOS - env: - CCACHE_COMPILERCHECK: content diff --git a/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml deleted file mode 100644 index 26b072ed55b04..0000000000000 --- a/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml +++ /dev/null @@ -1,81 +0,0 @@ -##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### -### please do rerun set-trigger-rules.py ### -trigger: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -pr: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -#### end trigger #### - -jobs: -- job: iOS_CI_on_Mac - pool: - vmImage: 'macOS-13' - variables: - PROTO_CACHE_DIR: $(Pipeline.Workspace)/proto_ccache - ORT_CACHE_DIR: $(Pipeline.Workspace)/ort_ccache - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - # Note: Keep the Xcode version and iOS simulator version compatible. - # Check the table here to see what iOS simulator versions are supported by a particular Xcode version: - # https://developer.apple.com/support/xcode/ - XCODE_VERSION: 14.3.1 - IOS_SIMULATOR_RUNTIME_VERSION: 16.4 - timeoutInMinutes: 150 - steps: - - template: templates/use-xcode-version.yml - parameters: - xcodeVersion: $(XCODE_VERSION) - - - template: templates/mac-build-step-with-cache.yml - parameters: - WithCache: true - Today: $(TODAY) - AdditionalKey: onnxruntime - CacheDir: $(ORT_CACHE_DIR) - ChangeEveryCommit: true - BuildStep: - - script: | - python3 $(Build.SourcesDirectory)/tools/ci_build/build.py \ - --skip_submodule_sync \ - --build_dir $(Build.BinariesDirectory)/iOS \ - --build_shared_lib \ - --use_coreml \ - --use_xnnpack \ - --ios \ - --apple_sysroot iphonesimulator \ - --osx_arch x86_64 \ - --apple_deploy_target=15.1 \ - --use_xcode \ - --config RelWithDebInfo \ - --build_apple_framework \ - --parallel --use_binskim_compliant_compile_flags - displayName: (CPU, CoreML, XNNPACK EPs) Build onnxruntime for iOS x86_64 and run tests using simulator - env: - CC: clang - CXX: clang++ - CCACHE_CPP2: 1 - CCACHE_DEPEND: 1 - CCACHE_SLOPPINESS: modules - CCACHE_DIR: $(ORT_CACHE_DIR) - ORT_GET_SIMULATOR_DEVICE_INFO_REQUESTED_RUNTIME_VERSION: $(IOS_SIMULATOR_RUNTIME_VERSION) diff --git a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml deleted file mode 100644 index 54c2e51c2a09b..0000000000000 --- a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml +++ /dev/null @@ -1,261 +0,0 @@ -##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### -### please do rerun set-trigger-rules.py ### -trigger: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -pr: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -#### end trigger #### - -parameters: -- name: RunOnnxRuntimeTests - displayName: Run Tests? - type: boolean - default: true - -stages: -- stage: x64_debug - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'Debug' - buildArch: x64 - additionalBuildFlags: --build_java --build_nodejs --build_wheel --disable_memleak_checker --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_debug - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - - - job: build_x64_asan - pool: 'onnxruntime-Win-CPU-2022' - timeoutInMinutes: 300 - steps: - - checkout: self - clean: true - submodules: none - - - template: templates/jobs/win-ci-prebuild-steps.yml - parameters: - EnvSetupScript: setup_env.bat - DownloadCUDA: false - BuildArch: x64 - BuildConfig: Debug - MachinePool: 'onnxruntime-Win-CPU-2022' - WithCache: false - Today: $(TODAY) - - - task: PythonScript@0 - displayName: 'Build and Test' - inputs: - scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py' - arguments: --config Debug --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer - workingDirectory: '$(Build.BinariesDirectory)' - - -- stage: x64_release - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - # Compare to our Nuget packaging pipeline, this job has "--build_wheel" but doesn't have "--enable_lto --disable_rtti --use_telemetry --enable_wcos" - # Python bindings use typeid so I can't disable RTTI here. If it causes a problem, we will need to split this job to two jobs. - additionalBuildFlags: --build_wheel --build_java --build_nodejs --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: x64_release_dnnl - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --build_wheel --use_dnnl --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: DNNL - GenerateDocumentation: false - WITH_CACHE: false - # Intel EPs require Intel CPUs - MachinePool: 'onnxruntime-Win2022-Intel-CPU' - -# Tests doesn't work on AMD CPUs -- stage: x64_release_xnnpack - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --build_wheel --use_xnnpack --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: XNNPACK - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -# Build only. Does not run any tests. -- stage: x64_release_vitisai - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --build_wheel --use_vitisai --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release - RunOnnxRuntimeTests: false - isTraining: false - ORT_EP_NAME: VITISAI - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: x64_release_winml - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --use_winml --enable_wcos --disable_rtti --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release_winml - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - # WinML has many warnings - EnablePython: false - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: x64_release_ep_generic_interface - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --enable_generic_interface --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release_ep_generic_interface - RunOnnxRuntimeTests: false # --enable_generic_interface does not build tests - EnablePython: false - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: x86_release - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - EnvSetupScript: setup_env_x86.bat - buildArch: x86 - additionalBuildFlags: --build_wheel --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: Win32 - isX86: true - job_name_suffix: x86_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: ort_training_apis_x64_release - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --enable_training_apis --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: ort_training_apis_x64_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - EnablePython: false - isTraining: true - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win2022-CPU-training-AMD' - -- stage: x64_release_azure - dependsOn: [] - jobs: - - job: x64_release_azure - steps: - - powershell: | - Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\RelWithDebInfo\_deps\vcpkg-src\installed\x86-windows\bin" - $env:PATH - Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\RelWithDebInfo\_deps\vcpkg-src\installed\x64-windows\bin" - $env:PATH - displayName: 'Append x64-windows and x86-windows to PATH' - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --use_azure --use_lock_free_queue --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release_azure - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - EnablePython: false - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022'