mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Update windows_build.yml
This commit is contained in:
@@ -1,48 +1,22 @@
|
||||
name: Windows Compile
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ "*" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
strategy:
|
||||
matrix:
|
||||
config: [Release, Debug]
|
||||
toolchain: [windows-msvc, windows-clang-cl]
|
||||
standalone: [OFF, ON]
|
||||
generate: [Visual Studio 17 2022, Ninja]
|
||||
arch: [x64, Win32]
|
||||
isPR:
|
||||
- ${{ github.event_name == 'pull_request' }}
|
||||
exclude:
|
||||
- toolchain: windows-clang-cl
|
||||
arch: Win32
|
||||
- isPR: true
|
||||
standalone: OFF
|
||||
exclude:
|
||||
- toolchain: windows-clang-cl
|
||||
arch: Win32
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build Visual Studio
|
||||
if: ${{ matrix.generate == 'Visual Studio 17 2022' }}
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }}
|
||||
cmake --build ./build/${{ matrix.arch }}
|
||||
- name: Setup Variables
|
||||
if: ${{ matrix.generate == 'Ninja' }}
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
- name: Build Ninja
|
||||
if: ${{ matrix.generate == 'Ninja' }}
|
||||
run: |
|
||||
cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }}
|
||||
cmake --build ./build/${{ matrix.arch }}
|
||||
cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v142 -A x64 -DCMAKE_BUILD_TYPE:STRING=Release
|
||||
cmake --build ./build/x64
|
||||
- name: Publish packaged artifacts
|
||||
if: ${{ matrix.config == 'Release' && matrix.generate == 'Visual Studio 17 2022' && matrix.standalone == 'ON' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: torch-windows-${{ matrix.arch }}-${{ matrix.toolchain }}
|
||||
path: build/${{ matrix.arch }}/Release/torch.exe
|
||||
name: torch-windows-x64
|
||||
path: build/x64/Debug/torch.exe
|
||||
|
||||
Reference in New Issue
Block a user