-
Notifications
You must be signed in to change notification settings - Fork 8
85 lines (65 loc) · 3.36 KB
/
ci-windows-main.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: windows-build
on: [push, pull_request]
jobs:
build_windows:
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
arch: [ x64 ]
toolchain: [ msvc, clang-cl ]
rhi_api : [D3D12, Vulkan]
shared : [shared, static]
name: ${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.rhi_api }}-${{ matrix.shared }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: nschloe/action-cached-lfs-checkout@v1
- name: Get current date as package key
id: cache_key
run: echo "key=$(date +'%W')" >> $GITHUB_OUTPUT
shell: bash
# For referring this directory in cache.
- name: Set xmake directory
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }}
- name: Setup project
run: ./setup.bat
- name: Update xmake repositories
run: xmake repo --update
# Fetch xmake dephash
- name: Calculate xmake dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages
key: ${{ matrix.os }}-${{ matrix.toolchain }}-${{ matrix.arch }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
- name: Configure xmake debug
run: xmake f --mode=debug --contract_assertion=y --thread_safe_assertion=y --arch=${{ matrix.arch }} --toolchain=${{ matrix.toolchain }} -c -y -v --rhi_debug=y --rhi_api=${{ matrix.rhi_api }} --shared=${{ matrix.shared == 'shared' && 'y' || 'n'}}
- name: Build debug
run: xmake build -y -v
- name: Install debug
run: xmake install -o ./install/${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.rhi_api }}-debug
- name: Configure xmake release
run: xmake f --mode=release --contract_assertion=n --thread_safe_assertion=n --arch=${{ matrix.arch }} --toolchain=${{ matrix.toolchain }} -c -y -v --rhi_debug=n --rhi_api=${{ matrix.rhi_api }} --shared=${{ matrix.shared == 'shared' && 'y' || 'n'}}
- name: Build release
run: xmake build -y -v
- name: Install release
run: xmake install -o ./install/${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.rhi_api }}-release
- name: Collect artifacts debug
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.rhi_api }}-${{ matrix.shared }}-debug
path: ./install/${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.rhi_api }}-debug
- name: Collect artifacts release
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.rhi_api }}-${{ matrix.shared }}-release
path: ./install/${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.rhi_api }}-release