|
1 | | -name: Build |
2 | | - |
3 | | -on: [push, pull_request] |
4 | | - |
5 | | -jobs: |
6 | | - build: |
7 | | - name: Build |
8 | | - runs-on: windows-latest |
9 | | - steps: |
10 | | - - uses: actions/checkout@v3 |
11 | | - with: |
12 | | - submodules: recursive |
13 | | - |
14 | | - - name: Cache Tools |
15 | | - id: cache-tools |
16 | | - uses: actions/cache@v3 |
17 | | - with: |
18 | | - path: C:\Tools |
19 | | - key: tools-${{ runner.os }}-${{ hashFiles('.github\workflows\build.yml') }} |
20 | | - |
21 | | - - if: ${{ steps.cache-tools.outputs.cache-hit != 'true' }} |
22 | | - name: Setup Tools |
23 | | - run: | |
24 | | - curl.exe --location --create-dirs -oC:\TEMP\widberg-windows-x86_64-a651e95e126117fa5d1323834c3aa9b18561d325.zip https://nightly.link/widberg/llvm-project-widberg-extensions/workflows/widberg-build/main/widberg-windows-x86_64-a651e95e126117fa5d1323834c3aa9b18561d325.zip |
25 | | - 7z.exe x C:\TEMP\widberg-windows-x86_64-a651e95e126117fa5d1323834c3aa9b18561d325.zip -aoa -oC:\Tools\llvm-widberg |
26 | | - curl.exe --location --create-dirs -oC:\TEMP\DXSDK_Aug08.exe https://archive.org/download/dxsdk_aug08/DXSDK_Aug08.exe |
27 | | - 7z.exe x C:\TEMP\DXSDK_Aug08.exe -aoa -oC:\Tools\DXSDK_Aug08 DXSDK/Include DXSDK/Lib |
28 | | -
|
29 | | - - name: Build |
30 | | - shell: cmd |
31 | | - run: | |
32 | | - for /f "delims=" %%i in ('"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath') do set VS_PATH=%%i |
33 | | - call "%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x86 |
34 | | - cmake -B build -GNinja -DLLVM_WIDBERG="C:\Tools\llvm-widberg" -DDXSDK_DIR=C:\Tools\DXSDK_Aug08\DXSDK |
35 | | - cmake --build build |
| 1 | +name: Build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +concurrency: |
| 6 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 7 | + cancel-in-progress: true |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + name: Build |
| 15 | + runs-on: windows-latest |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 18 | + with: |
| 19 | + submodules: recursive |
| 20 | + persist-credentials: false |
| 21 | + |
| 22 | + - name: Resolve LLVM Nightly Installer |
| 23 | + id: resolve-llvm |
| 24 | + shell: pwsh |
| 25 | + env: |
| 26 | + GH_TOKEN: ${{ github.token }} |
| 27 | + run: | |
| 28 | + "asset_name=$(gh release view nightly --repo widberg/llvm-project-widberg-extensions --json assets --jq '.assets[] | select(.name | endswith(".exe")) | .name')" >> $env:GITHUB_OUTPUT |
| 29 | +
|
| 30 | + - name: Cache LLVM Widberg |
| 31 | + id: cache-llvm |
| 32 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 |
| 33 | + with: |
| 34 | + path: C:\Tools\llvm-widberg |
| 35 | + key: llvm-widberg-${{ runner.os }}-${{ steps.resolve-llvm.outputs.asset_name }} |
| 36 | + |
| 37 | + - if: ${{ steps.cache-llvm.outputs.cache-hit != 'true' }} |
| 38 | + name: Install LLVM Widberg |
| 39 | + shell: pwsh |
| 40 | + env: |
| 41 | + GH_TOKEN: ${{ github.token }} |
| 42 | + LLVM_ASSET_NAME: ${{ steps.resolve-llvm.outputs.asset_name }} |
| 43 | + run: | |
| 44 | + gh release download nightly --repo widberg/llvm-project-widberg-extensions --pattern "$env:LLVM_ASSET_NAME" --dir C:\TEMP --clobber |
| 45 | + Start-Process -FilePath "C:\TEMP\$env:LLVM_ASSET_NAME" -ArgumentList '/S','/D=C:\Tools\llvm-widberg' -Wait |
| 46 | +
|
| 47 | + - name: Cache DXSDK |
| 48 | + id: cache-dxsdk |
| 49 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 |
| 50 | + with: |
| 51 | + path: C:\Tools\DXSDK_Aug08 |
| 52 | + key: dxsdk-aug08-${{ runner.os }}-1 |
| 53 | + |
| 54 | + - if: ${{ steps.cache-dxsdk.outputs.cache-hit != 'true' }} |
| 55 | + name: Install DXSDK |
| 56 | + shell: pwsh |
| 57 | + run: | |
| 58 | + curl.exe --location --create-dirs -oC:\TEMP\DXSDK_Aug08.exe https://archive.org/download/dxsdk_aug08/DXSDK_Aug08.exe |
| 59 | + 7z.exe x C:\TEMP\DXSDK_Aug08.exe -aoa -oC:\Tools\DXSDK_Aug08 DXSDK/Include DXSDK/Lib |
| 60 | +
|
| 61 | + - name: Build |
| 62 | + shell: pwsh |
| 63 | + run: | |
| 64 | + cmd /d /s /c ('"' + (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath) + '\VC\Auxiliary\Build\vcvarsall.bat" x86 && cmake -B build -GNinja -DLLVM_WIDBERG="C:\Tools\llvm-widberg" -DDXSDK_DIR=C:\Tools\DXSDK_Aug08\DXSDK && cmake --build build') |
0 commit comments