windows #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |