## Copyright 2022 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

name: CI Windows Workflow
on:
  push:
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build-windows-msvc15:
    secrets: inherit
    uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
    with:
      force-delete: true    # guarantees .gitattributes are respected in working dir
      submodules: true
      runs-on: '[ "Windows", "build" ]'
      artifact-out: build-windows-msvc15
      artifact-path: ./build/install
      cmd: gitlab\build.bat "Visual Studio 15 2017 Win64" "v141" "Release"

  build-windows-msvc15-TBB2020:
    secrets: inherit
    uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
    with:
      force-delete: true    # guarantees .gitattributes are respected in working dir
      submodules: true
      runs-on: '[ "Windows", "build" ]'
      artifact-out: build-windows-msvc15-TBB2020
      artifact-path: ./build/install
      cmd: gitlab\build.bat "Visual Studio 15 2017 Win64" "v141" "Release" '"-DTBB_VERSION=2020.3"' '"-DTBB_HASH="""'

  test-windows-msvc15:
    needs: build-windows-msvc15
    secrets: inherit
    uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
    with:
      runs-on: '[ "Windows", "build" ]'
      artifact-in: build-windows-msvc15
      cmd: |
        gitlab\run_tests.bat

  test-windows-msvc15-TBB2020:
    needs: build-windows-msvc15-TBB2020
    secrets: inherit
    uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
    with:
      runs-on: '[ "Windows", "build" ]'
      artifact-in: build-windows-msvc15-TBB2020
      cmd: |
        gitlab\run_tests.bat