|
| 1 | +# yamllint disable rule:line-length |
| 2 | +name: CI_WINDOWS |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + workflow_call: |
| 7 | + push: |
| 8 | + branches: [main] |
| 9 | + |
| 10 | +concurrency: |
| 11 | + # A PR number if a pull request and otherwise the commit hash. This cancels |
| 12 | + # queued and in-progress runs for the same PR (presubmit) or commit |
| 13 | + # (postsubmit). |
| 14 | + group: ci-build-test-cpp-windows-${{ github.event.number || github.sha }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + |
| 19 | + build-test-windows: |
| 20 | + strategy: |
| 21 | + fail-fast: true |
| 22 | + matrix: |
| 23 | + torch-version: [nightly] |
| 24 | + name: Build (Windows, torch-${{ matrix.torch-version }}) |
| 25 | + runs-on: windows-latest |
| 26 | + defaults: |
| 27 | + run: |
| 28 | + shell: bash |
| 29 | + env: |
| 30 | + CACHE_DIR: ${{ github.workspace }}\.container-cache |
| 31 | + steps: |
| 32 | + - name: "Checking out repository" |
| 33 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 34 | + with: |
| 35 | + submodules: true |
| 36 | + |
| 37 | + - name: Setup workspace |
| 38 | + uses: ./.github/actions/setup-build |
| 39 | + |
| 40 | + - name: Enable cache |
| 41 | + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 |
| 42 | + with: |
| 43 | + path: ${{ env.CACHE_DIR }} |
| 44 | + # Use as cache key a PR number if a pull request and otherwise the commit hash. This reuses the cache for a PR irrespective of the commit hash. Otherwise, it uses commit hash for merges into the main branch |
| 45 | + key: build-test-cpp-asserts-windows-${{ matrix.torch-version }}-v2-${{ github.event.number || github.sha }} |
| 46 | + restore-keys: | |
| 47 | + build-test-cpp-asserts-windows-${{ matrix.torch-version }}-v2- |
| 48 | +
|
| 49 | + - name: "Configuring MSVC" |
| 50 | + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 |
| 51 | + |
| 52 | + - name: Install python deps (torch-${{ matrix.torch-version }}) |
| 53 | + run: | |
| 54 | + ./build_tools/ci/install_python_deps.sh ${{ matrix.torch-version }} |
| 55 | +
|
| 56 | + - name: ccache |
| 57 | + uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16 |
| 58 | + with: |
| 59 | + key: ${{ github.job }}-${{ matrix.torch-version }} |
| 60 | + save: ${{ needs.setup.outputs.write-caches == 1 }} |
| 61 | + |
| 62 | + - name: Build project |
| 63 | + run: | |
| 64 | + cache_dir="${{ env.CACHE_DIR }}" \ |
| 65 | + ./build_tools/python_deploy/build_windows_ci.sh |
| 66 | +
|
| 67 | + - name: Save cache |
| 68 | + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 |
| 69 | + if: ${{ !cancelled() }} |
| 70 | + with: |
| 71 | + path: ${{ env.CACHE_DIR }} |
| 72 | + key: build-test-cpp-asserts-windows-${{ matrix.torch-version }}-v2-${{ github.event.number || github.sha }} |
| 73 | + |
| 74 | + # todo: enable when use of `signal` for timeout is enhanced to be platform-agnostic |
| 75 | + # - name: Integration tests (torch-${{ matrix.torch-version }}) |
| 76 | + # run: | |
| 77 | + # ./build_tools/ci/test_posix.sh ${{ matrix.torch-version }} |
0 commit comments