-
Notifications
You must be signed in to change notification settings - Fork 1.5k
199 lines (173 loc) · 5.95 KB
/
wheel-macos.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
name: macos-wheels
on:
push: # run on push events
paths-ignore: # but ignore everything in the docs subfolder
- 'docs/**'
- 'src/gui*/**'
- 'src/netedit/**'
- 'tests/netedit/**'
branches:
- '**'
tags:
- '*'
pull_request: # run on pull requests
paths-ignore: # but ignore everything in the docs subfolder
- 'docs/**'
workflow_dispatch:
schedule:
- cron: '25 2 * * *'
jobs:
build-wheels:
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14]
python_version: [3.8, 3.9, '3.10', 3.11, 3.12]
exclude:
- os: macos-14
python_version: 3.8
- os: macos-14
python_version: 3.9
runs-on: ${{ matrix.os }}
env:
CCACHE_COMPILERTYPE: clang
steps:
- name: Cloning SUMO
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetching SUMO tags
run: git fetch --tags --force
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Preparing Build System
run: |
brew update
brew upgrade || brew link --overwrite [email protected]
brew install --cask xquartz
brew install xerces-c fox proj gdal gl2ps ccache googletest fmt
- name: ccache
if: github.event_name != 'schedule'
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.python_version }}-${{ matrix.os }}
- name: Building SUMO / Libsumo wheels
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build
cp build_config/pyproject.toml .
python3 tools/build_config/version.py tools/build_config/setup-sumo.py ./setup.py
python3 -m build --wheel
python3 tools/build_config/version.py tools/build_config/setup-libsumo.py tools/setup.py
python3 -m build --wheel tools -o dist
if [[ "${{ matrix.python_version }}" != "3.12" ]]; then rm dist/eclipse_sumo-*; fi
if [[ "${{ matrix.python_version }}" == "3.12" ]]; then mv dist/eclipse_sumo-* `echo dist/eclipse_sumo-* | sed 's/cp312-cp312/py2.py3-none/'`; fi
- name: Uploading artifacts (Python wheels)
uses: actions/upload-artifact@v4
with:
name: python-${{ matrix.python_version }}-${{ matrix.os }}-wheels
path: dist
###################
# testing wheels
###################
test-wheels:
needs: [build-wheels]
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14, macos-15]
python_version: ['3.10', 3.11, 3.12]
include:
- os: macos-13
python_version: 3.8
- os: macos-13
python_version: 3.9
runs-on: ${{ matrix.os }}
steps:
- name: Cloning SUMO
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Downloading Wheels artifact
uses: actions/download-artifact@v4
with:
path: python-wheels
merge-multiple: true
- name: Configuring Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Installing dependencies
run: |
brew update
brew upgrade || brew link --overwrite [email protected]
brew install --cask xquartz
brew install xerces-c fox proj gdal gl2ps fmt
- name: Preparing Python environment
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel # need to do this separately because the texttest install wants it
python3 -m pip install texttest
python3 -m pip install -f python-wheels eclipse_sumo
python3 -c "import sumo; print('SUMO_HOME=' + sumo.SUMO_HOME)" >> $GITHUB_ENV
- name: Running "sumo in the wheel" tests
if: github.repository == 'DLR-TS/sumo'
run: |
if [[ "${{ matrix.python_version }}" != "3.12" ]]; then python3 -m pip install -r tools/requirements.txt; fi
tests/runTests.sh -b ci -v ci.fast -a activitygen,duarouter,jtrrouter,marouter,od2trips,polyconvert
- name: Running meta tests and cleaning up
run: |
tests/runTests.sh -b ci -v ci -ts meta
python3 -m pip uninstall -y eclipse-sumo
- name: Building helper wheels
run: |
cd tools
python3 -m pip install build
python3 build_config/version.py build_config/setup-sumolib.py ./setup.py
python3 -m build --wheel
python3 build_config/version.py build_config/setup-traci.py ./setup.py
python3 -m build --wheel
- name: Running libsumo tests
run: |
python3 -m pip install -f tools/dist sumolib traci
python3 -m pip install -f python-wheels libsumo
cd tests
texttest -b ci -v ci -a complex.libsumo
- name: Compressing test results
if: failure()
run: |
zip -r texttesttmp.zip ~/.texttest/tmp
- name: Uploading test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: texttesttmp-${{ matrix.python_version }}-${{ matrix.os }}
path: texttesttmp.zip
if-no-files-found: warn
###################
# publishing wheels
###################
publish-wheels:
if: github.repository == 'eclipse-sumo/sumo' && (github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags'))
needs: [test-wheels]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: python-wheels
merge-multiple: true
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python-wheels/
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@release/v1
with:
packages-dir: python-wheels/