-
Notifications
You must be signed in to change notification settings - Fork 20
60 lines (60 loc) · 2.06 KB
/
ci-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: CI (Windows)
on:
workflow_call:
jobs:
build:
name: Windows
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate cache keys
run: |
echo "target=${{ runner.os }}-target" >> $env:GITHUB_OUTPUT
echo "vulkan=${{ runner.os }}-vulkan-1.3.290.0" >> $env:GITHUB_OUTPUT
id: cache-keys
- name: Restore Vulkan SDK
uses: actions/cache/restore@v4
with:
path: C:\VulkanSDK
key: ${{ steps.cache-keys.outputs.vulkan }}
id: restore-vulkan
- name: Install Vulkan SDK
run: |
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe" -OutFile VulkanSDK.exe
.\VulkanSDK.exe --root C:\VulkanSDK --accept-licenses --default-answer --confirm-command install
echo "new-install=true" >> $env:GITHUB_OUTPUT
id: install-vulkan
if: ${{ steps.restore-vulkan.outputs.cache-hit != 'true' }}
- name: Set Vulkan SDK path
run: echo "VULKAN_SDK=C:\VulkanSDK" >> $env:GITHUB_ENV
- name: Restore target directory
uses: actions/cache/restore@v4
with:
path: target
key: ${{ steps.cache-keys.outputs.target }}
- name: Update Rust
run: rustup update stable
- name: Add additional Rust targets
run: rustup target add x86_64-unknown-none
- name: Build
run: python3 build.py -r
- name: Run tests
run: cargo test
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: obliteration-win-x64
path: dist
- name: Cache target directory
uses: actions/cache/save@v4
with:
path: target
key: ${{ steps.cache-keys.outputs.target }}-${{ github.run_id }}
if: startsWith(github.ref, 'refs/heads/')
- name: Cache Vulkan SDK
uses: actions/cache/save@v4
with:
path: C:\VulkanSDK
key: ${{ steps.cache-keys.outputs.vulkan }}
if: startsWith(github.ref, 'refs/heads/') && steps.install-vulkan.outputs.new-install == 'true'