forked from eclipse-sumo/sumo
-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (131 loc) · 4.3 KB
/
wheel-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
name: windows-wheels
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-wheels:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_type: [libsumo]
python: [3.7, 3.8, 3.9, '3.10']
include:
- build_type: sumo
python: 3.8
env:
CC: cl
CXX: cl
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: Configuring Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
architecture: x64
- name: "Set up compiler cache"
uses: actions/cache@v2
with:
path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
key: ${{ matrix.build_type }}-${{ matrix.python }}-${{ github.head_ref }}-${{ github.run_number }}
restore-keys: |
${{ matrix.build_type }}-${{ matrix.python }}-${{ github.head_ref }}-
${{ matrix.build_type }}-${{ matrix.python }}-
# required for CMake to find Ninja
- name: "Set up MSVC Developer Command Prompt"
uses: seanmiddleditch/gha-setup-vsdevenv@v3
- name: Configuring SUMO plain build
if: matrix.build_type == 'libsumo'
run: |
python -m pip install wheel
cd sumo
mkdir build_msvc
cd build_msvc
cmake .. -GNinja -DCHECK_OPTIONAL_LIBS=false
- name: Building libsumo plain
if: matrix.build_type == 'libsumo'
run: |
cd sumo
cmake --build build_msvc --config Release --target libsumo libtraci
xcopy /s data .\tools\libsumo\data\
python tools\build\setup-libsumo.py bdist_wheel --plat-name win_amd64
python tools\build\setup-libtraci.py bdist_wheel --plat-name win_amd64
- name: Building SUMO Wheels
if: matrix.build_type == 'sumo'
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 -GNinja
# we should rename the sumo wheel here
- name: Uploading artifacts
uses: actions/upload-artifact@v1
with:
name: Py3-${{ matrix.build_type }}-wheels
path: sumo/dist
- name: Plain libsumo tests
if: matrix.build_type == 'libsumo'
run: |
$env:PATH += ";$pwd\sumo\bin"
$env:TEXTTEST_TMP = "D:/texttest"
cd sumo/build_msvc
$env:TEXTTEST_CI_APPS = "-a complex.libsumo -ts vehicle/v"
ctest -R texttest --verbose
copy Testing/Temporary/LastTest.log D:/texttest
- name: Uploading test results
if: always()
uses: actions/upload-artifact@v2
with:
name: texttesttmp-${{ matrix.build_type }}-${{ matrix.python }}
path: D:/texttest
if-no-files-found: warn
###################
# PUBLISHING wheels
###################
publish-wheels:
if: github.repository == 'eclipse/sumo' && (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags'))
needs: [build-wheels]
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
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}