-
Notifications
You must be signed in to change notification settings - Fork 6
257 lines (211 loc) · 7.28 KB
/
build.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: Build Pythia
on: [push]
env:
PYTHON_VERSION: 3.10.9
jobs:
Create-Interpreters:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, ubuntu-20.04]
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Cache interpreters
uses: actions/cache@v3
id: cache
with:
path: python-${{ env.PYTHON_VERSION }}-${{ runner.os }}.tar
key: interpreters-${{ env.PYTHON_VERSION }}-${{ runner.os }}-${{ secrets.CACHE_VERSION }}
- name: Check out repository code
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
- name: Install requirements
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements.txt
- name: Create interpreters
if: steps.cache.outputs.cache-hit != 'true'
run: python tools/build.py create_interpreters ${{ env.PYTHON_VERSION }} --dest .
- name: Tar interpreters
if: steps.cache.outputs.cache-hit != 'true'
run: tar cvf python-${{ env.PYTHON_VERSION }}-${{ runner.os }}.tar python-*-embed-*
- uses: actions/upload-artifact@v4
with:
name: _Internal_Python_Interpreters-${{ runner.os }}
path: python-*.tar
if-no-files-found: error
retention-days: 1
Build-Binaries:
needs: Create-Interpreters
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019, ubuntu-20.04]
arch: [x64, x86]
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Check out repository code
uses: actions/checkout@v3
- name: Create the directory
run: mkdir "@Pythia"
- name: Download the interpreters
uses: actions/download-artifact@v4
with:
name: _Internal_Python_Interpreters-${{ runner.os }}
- name: Untar the interpreter
run: tar xf ../python-${{ env.PYTHON_VERSION }}-${{ runner.os }}.tar
working-directory: "@Pythia"
# Build the extension
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ runner.os == 'Windows' }}
with:
arch: ${{ matrix.arch }}
- name: Perform build
run: python tools/build.py build_binaries ${{ env.PYTHON_VERSION }} ${{ matrix.arch }} ${{ runner.os }}
- uses: actions/upload-artifact@v4
with:
name: _Internal_Pythia_Binaries-${{ runner.os }}-${{ matrix.arch }}
path: |
@Pythia/*.dll
@Pythia/*.so
@Pythia/*.exe
@Pythia/PythiaTester*
if-no-files-found: error
retention-days: 1
Build-PBO:
runs-on: windows-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Check out repository code
uses: actions/checkout@v3
- name: Cache tools
uses: actions/cache@v3
with:
path: tools/cache
key: tools_cache
# Build PBOs and pack
- name: Install Mikero's tools
uses: arma-actions/mikero-tools@bec8b18fc507ee3180cadeaf35249d3f2702b1ff
- run: python tools/build.py build_pbos
- uses: actions/upload-artifact@v4
with:
name: _Internal_Pythia_PBOs
path: |
@Pythia/addons
@Pythia/keys
if-no-files-found: error
retention-days: 1
Test-Binaries:
needs: Build-Binaries
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019, ubuntu-20.04]
arch: [x64, x86]
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Check out repository code
uses: actions/checkout@v3
- name: Create the directory
run: mkdir "@Pythia"
- name: Download the interpreters
uses: actions/download-artifact@v4
with:
name: _Internal_Python_Interpreters-${{ runner.os }}
- name: Untar the interpreter
run: tar xf ../python-${{ env.PYTHON_VERSION }}-${{ runner.os }}.tar
working-directory: "@Pythia"
- name: Download the binaries
uses: actions/download-artifact@v4
with:
name: _Internal_Pythia_Binaries-${{ runner.os }}-${{ matrix.arch }}
path: "@Pythia"
- name: Set testers permissions
run: chmod a+x @Pythia/PythiaTester*
- name: Install multilib for compiling 32bit Cython extensions (in tests)
if: runner.os == 'Linux' && matrix.arch == 'x86'
run: sudo apt install -y gcc-multilib
- name: Copy templates
run: python tools/build.py copy_templates ${{ env.PYTHON_VERSION }}
- name: Run basic tests
run: python tools/build.py run_tests ${{ env.PYTHON_VERSION }} ${{ matrix.arch }} ${{ runner.os }}
Consolidate:
needs:
- Create-Interpreters
- Build-Binaries
- Build-PBO
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Check out repository code
uses: actions/checkout@v3
- name: Download the binaries
uses: actions/download-artifact@v4
with:
pattern: _Internal_Pythia_Binaries-*
path: "@Pythia"
merge-multiple: true
- name: Download the PBOs
uses: actions/download-artifact@v4
with:
name: _Internal_Pythia_PBOs
path: "@Pythia"
- name: Download the interpreters
uses: actions/download-artifact@v4
with:
pattern: _Internal_Python_Interpreters-*
merge-multiple: true
- name: Set testers permissions
run: chmod a+x @Pythia/PythiaTester*
- name: Copy templates
run: python tools/build.py copy_templates ${{ env.PYTHON_VERSION }}
- name: Unpack interpreters
run: for i in python-*.tar; do tar xf "$i" --directory "@Pythia"; done
- run: pip install -r requirements.txt
- run: python tools/build.py safety_checks ${{ env.PYTHON_VERSION }}
- name: Remove linux 32bit Pythia
run: rm -rf @Pythia/python-*-embed-linux32 @Pythia/Pythia.so @Pythia/PythiaSetPythonPath.so @Pythia/PythiaTester @Pythia/install_requirements32.sh
- run: tar -jcf "@Pythia.tbz" "@Pythia"
- uses: actions/upload-artifact@v4
# if: ${{ github.ref == 'refs/heads/master' }}
with:
name: Pythia
path: "@Pythia.tbz"
if-no-files-found: error
retention-days: 8
# Deploy-dev:
# needs:
# - Consolidate
# runs-on: ubuntu-latest
# environment: Dev-deploy
# steps:
# - name: Download the release
# uses: actions/download-artifact@v4
# with:
# name: Pythia
#
# - name: Unpack the release
# run: tar xf @Pythia.tbz
#
# - name: Upload to Workshop as Pythia-dev
# uses: arma-actions/workshop-upload@v1
# if: github.event_name == 'push' && github.actor != 'depbot'
# with:
# appId: '107410' # default
# itemId: '2705521455' # ID of item to update
# contentPath: '@Pythia'
# changelog: 'Automatic push by CI'
# env:
# STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
# STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}