-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (184 loc) · 5.94 KB
/
build-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
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
name: windows
on:
push: # run on push events
paths-ignore: # but ignore everything in the docs subfolder
- 'docs/**'
branches:
- '**'
tags:
- '*'
pull_request: # run on pull requests
paths-ignore: # but ignore everything in the docs subfolder
- 'docs/**'
schedule:
- cron: '5 1 * * *'
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
build-type: [plain, extra, wheel]
steps:
- name: Cloning SUMO
uses: actions/checkout@v2
with:
path: sumo
fetch-depth: 0
- name: Fetching SUMO tags
run: |
cd sumo
git fetch --tags --force
- name: Cloning SUMO Libraries
uses: actions/checkout@v2
with:
repository: DLR-TS/SUMOLibraries
path: sumolibraries
- name: Cloning SUMO Libraries Submodules
run: |
cd sumolibraries
git submodule sync --recursive
git submodule update --init --force --recursive --depth=1
- name: Configuring Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64
- name: Building SUMO plain
if: matrix.build-type == 'plain'
run: |
python -m pip install wheel
cd sumo
mkdir build_msvc
cd build_msvc
cmake .. -G"Visual Studio 16 2019" -A x64 -DCHECK_OPTIONAL_LIBS=false
cmake --build . --config Release
cd ..
python tools\build\setup-libsumo.py bdist_wheel --plat-name win_amd64
- name: Building SUMO extra
if: matrix.build-type == 'extra'
run: |
cd sumo
mkdir build_msvc
cd build_msvc
cmake -DFMI=ON .. -G"Visual Studio 16 2019" -A x64 -DCHECK_OPTIONAL_LIBS=true
cmake --build . --config Release
- name: Building SUMO Wheels
if: matrix.build-type == 'wheel'
run: |
python -m pip install wheel scikit-build
cd sumo
python tools\build\setup-sumolib.py bdist_wheel
python tools\build\setup-traci.py bdist_wheel
python tools\build\setup-sumo.py bdist_wheel --plat-name win_amd64 -G "Visual Studio 16 2019"
# we should rename the sumo wheel here
- name: Configuring Python 3.5
if: matrix.build-type == 'plain'
uses: actions/setup-python@v1
with:
python-version: 3.5
architecture: x64
- name: Building libsumo with Python 3.5
if: matrix.build-type == 'plain'
run: |
python -m pip install wheel
cd sumo
cmake --build build_msvc --config Release
python tools\build\setup-libsumo.py bdist_wheel --plat-name win_amd64
- name: Configuring Python 3.6
if: matrix.build-type == 'plain'
uses: actions/setup-python@v1
with:
python-version: 3.6
architecture: x64
- name: Building libsumo with Python 3.6
if: matrix.build-type == 'plain'
run: |
python -m pip install wheel
cd sumo
cmake --build build_msvc --config Release
python tools\build\setup-libsumo.py bdist_wheel --plat-name win_amd64
- name: Configuring Python 3.7
if: matrix.build-type == 'plain'
uses: actions/setup-python@v1
with:
python-version: 3.7
architecture: x64
- name: Building libsumo with Python 3.7
if: matrix.build-type == 'plain'
run: |
python -m pip install wheel
cd sumo
cmake --build build_msvc --config Release
python tools\build\setup-libsumo.py bdist_wheel --plat-name win_amd64
- name: Building TraaS, examples and tests
if: matrix.build-type != 'wheel'
run: |
cd sumo/build_msvc
cmake --build . --config Release --target traas
cmake --build . --config Release --target examples
ctest --verbose
- name: Uploading artifacts (SUMO binaries)
if: matrix.build-type != 'wheel'
uses: actions/upload-artifact@v1
with:
name: Windows-${{ matrix.build-type }}
path: sumo/bin
- name: Uploading artifacts (libsumo wheels)
if: matrix.build-type == 'plain'
uses: actions/upload-artifact@v1
with:
name: Py3-libsumo-wheels
path: sumo/dist
- name: Uploading artifacts (Python wheels)
if: matrix.build-type == 'wheel'
uses: actions/upload-artifact@v1
with:
name: Py3-sumo-wheels
path: sumo/dist
- name: Building FMU Compliance Checker
if: matrix.build-type == 'extra'
run: |
git clone https://github.com/modelica-tools/FMUComplianceChecker.git fmuChecker
cd fmuChecker
mkdir build
cd build
cmake -G "Visual Studio 16 2019" ..
cmake --build . --config MinSizeRel --target install
- name: Checking sumo-fmi2.fmu
if: matrix.build-type == 'extra'
run: |
$env:Path = "$env:Path;$pwd\sumo\bin"
echo $env:Path
cd sumo
../fmuChecker/install/fmuCheck.win64 bin/sumo-fmi2-win64.fmu
- name: Uploading FMI 2.0 FMU artifacts
if: matrix.build-type == 'extra'
uses: actions/upload-artifact@v1
with:
name: sumo-fmi2-win64
path: sumo/bin/sumo-fmi2-win64.fmu
###################
# PUBLISHING wheels
###################
publish-wheels:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- name: Moving artifacts
run: |
ls -lR
mkdir dist
mv ./*-wheels/* dist
mv dist/eclipse_sumo-*cp38* `echo dist/eclipse_sumo-*cp38* | sed 's/cp38-cp38/py2.py3-none/'`
- name: Publish to Test PyPI
if: github.event_name == 'schedule'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}