-
Notifications
You must be signed in to change notification settings - Fork 30
181 lines (157 loc) · 5.7 KB
/
build-utilities.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: 'Build utilities'
on:
push:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'gamedata/**'
- 'sdk/**'
- 'src/**'
- '**/CMakeLists.txt'
- '**/*.ltx'
- '**/*.json'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'gamedata/**'
- 'sdk/**'
- 'src/**'
- '**/CMakeLists.txt'
- '**/*.ltx'
- '**/*.json'
defaults:
run:
shell: pwsh
jobs:
build-utilities:
name: 'Build utilities'
strategy:
matrix:
system:
- windows-2022
preset:
- Utilities
platform:
- x64
config:
- Debug
- RelWithDebInfo
- Release
runs-on: ${{ matrix.system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache packages
uses: actions/cache@v4
with:
key: ${{ matrix.preset }}-NuGet-${{ hashFiles('**/Packages.config') }}
restore-keys: |
${{ matrix.preset }}-NuGet-${{ hashFiles('**/Packages.config') }}
${{ matrix.preset }}-NuGet-
path: |
~/.nuget/packages
- name: Configure utilities
run: |
cmake --preset ${{ matrix.preset }}-${{ matrix.platform }}-${{ runner.os }} -DIXRAY_CI=ON
- name: Build utilities
run: |
cmake --build --preset ${{ matrix.preset }}-${{ matrix.platform }}-${{ runner.os }}-${{ matrix.config }}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: utilities-binaries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.exe
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.dll
- name: Upload symbols
uses: actions/upload-artifact@v4
if: ${{ matrix.config != 'Release' }}
with:
name: utilities-symbols-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.pdb
- name: Upload libraries
uses: actions/upload-artifact@v4
with:
name: utilities-libraries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/lib/${{ matrix.config }}/
- name: Upload packages
uses: actions/upload-artifact@v4
if: ${{ (matrix.config == 'Debug' && matrix.platform == 'x64') }}
with:
name: utilities-packages-${{ matrix.system }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/packages/
build-targets:
name: 'Build targets'
strategy:
matrix:
system:
- ubuntu-22.04
preset:
- Targets
platform:
- x64
config:
- Debug
- RelWithDebInfo
- Release
defaults:
run:
shell: bash
runs-on: ${{ matrix.system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Ninja
uses: imesense/[email protected]
- name: Configure targets
run: |
cmake \
-S . \
-B build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }} \
-G "Ninja Multi-Config" \
-DCMAKE_C_COMPILER=clang-14 \
-DCMAKE_CXX_COMPILER=clang++-14 \
-DIXRAY_UTILS=ON \
-DIXRAY_CI=ON
- name: Build targets
run: |
cmake \
--build build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }} \
--target TextureCloner \
--config ${{ matrix.config }} \
-j$(nproc)
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: targets-binaries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/
!build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.pdb
!build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.debug
if-no-files-found: ignore
- name: Upload symbols
uses: actions/upload-artifact@v4
if: ${{ matrix.config != 'Release' }}
with:
name: targets-symbols-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.pdb
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.debug
if-no-files-found: ignore
- name: Upload libraries
uses: actions/upload-artifact@v4
with:
name: targets-libraries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/lib/${{ matrix.config }}/
if-no-files-found: ignore