-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (142 loc) · 4.58 KB
/
build-linux.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
name: linux
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:
###########################
# BUILDING ON LINUX
###########################
build:
runs-on: ubuntu-latest
strategy:
# Allow all other matrix-jobs to continue running, even if one of the jobs fails
fail-fast: false
matrix:
build_type: [full, minimal]
compiler: [gcc, clang]
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: Preparing Build System
run: |
sudo apt-get update
sudo apt-get install cmake libeigen3-dev libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgtest-dev libgoogle-perftools-dev libgl2ps-dev python3-dev python3-setuptools swig openjdk-8-jdk maven ccache
sudo pip3 install texttest
- name: Preparing Gtest
run: |
pushd /usr/src/gtest
sudo mkdir build
cd build
if [[ "${{ matrix.compiler }}" == "gcc" ]]; then sudo CC=gcc CXX=g++ cmake ..; fi
if [[ "${{ matrix.compiler }}" == "clang" ]]; then sudo CC=clang CXX=clang++ cmake ..; fi
sudo make
sudo cp libgtest* /usr/lib/
- name: Building SUMO
run: |
mkdir -p sumo/cmake-build
cd sumo/cmake-build
if [[ "${{ matrix.compiler }}" == "gcc" ]]; then export CC=gcc; export CXX=g++; fi
if [[ "${{ matrix.compiler }}" == "clang" ]]; then export CC=clang; export CXX=clang++; fi
if [[ "${{ matrix.build_type }}" == "full" ]]; then cmake -DFMI=ON ..; fi
if [[ "${{ matrix.build_type }}" == "minimal" ]]; then cmake -DFOX_CONFIG= -DPROJ_LIBRARY= -DCHECK_OPTIONAL_LIBS=OFF ..; fi
make -j4
- name: Building Traas
run: |
cd sumo/cmake-build
make traas
- name: Installing SUMO
run: |
cd sumo/cmake-build
sudo make install
- name: Building Examples and Tests
run: |
cd sumo/cmake-build
if [[ "${{ matrix.build_type }}" == "full" ]]; then make CTEST_OUTPUT_ON_FAILURE=1 examples test; fi
- name: Uploading artifacts (SUMO binaries)
uses: actions/upload-artifact@v1
with:
name: Linux-${{ matrix.compiler }}-${{ matrix.build_type }}
path: sumo/bin
- name: Building FMU Compliance Checker
if: matrix.build_type == 'full'
run: |
git clone https://github.com/modelica-tools/FMUComplianceChecker.git fmuChecker
cd fmuChecker
mkdir build
cd build
cmake ..
make install test
- name: Checking sumo-fmi2.fmu
if: matrix.build_type == 'full'
run: |
cd sumo
../fmuChecker/install/fmuCheck.linux64 bin/sumo-fmi2-linux64.fmu
- name: Uploading FMI 2.0 FMU artifacts
if: matrix.build_type == 'full'
uses: actions/upload-artifact@v1
with:
name: sumo-fmi2-linux64
path: sumo/bin/sumo-fmi2-linux64.fmu
###################
# BUILDING wheels
###################
build-manylinux-wheels:
runs-on: ubuntu-latest
steps:
- name: Cloning SUMO
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetching SUMO tags
run: |
git fetch --tags --force
- name: Building Python wheels
uses: docker://quay.io/pypa/manylinux2014_x86_64
with:
entrypoint: tools/build/build_wheels.sh
- name: Uploading artifacts (Python wheels)
uses: actions/upload-artifact@v1
with:
name: manylinux-wheels
path: wheelhouse
###################
# PUBLISHING wheels
###################
publish-wheels:
needs: [build-manylinux-wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- name: Moving artifacts
run: |
ls -lR
mkdir dist
mv ./*-wheels/* dist
- 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 }}