-
Notifications
You must be signed in to change notification settings - Fork 1.5k
147 lines (128 loc) · 5.46 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
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 0 * * *'
jobs:
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]
jps_version: ['v1.0.5']
# include:
# - build_type: full
# jps_version: master
# compiler: gcc
steps:
- name: Cloning SUMO
uses: actions/checkout@v4
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 libunwind-dev # to work around https://bugs.launchpad.net/ubuntu/+source/google-glog/+bug/1991919
sudo apt-get install cmake libeigen3-dev libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev
sudo apt-get install libgtest-dev libgoogle-perftools-dev libgl2ps-dev python3-dev python3-setuptools swig
sudo apt-get install maven ccache libv8-dev gettext
sudo pip3 install texttest
- name: Validate CITATION.cff
if: matrix.build_type == 'full' && github.repository == 'DLR-TS/sumo' && github.event_name == 'schedule' && matrix.compiler == 'gcc'
uses: dieghernan/[email protected]
with:
citation-path: sumo/CITATION.cff
- name: ccache
if: github.event_name != 'schedule'
uses: hendrikmuhs/[email protected]
- name: Cloning jupedsim
if: matrix.build_type == 'full' && github.repository == 'DLR-TS/sumo'
uses: actions/checkout@v4
with:
repository: PedestrianDynamics/jupedsim
ref: ${{ matrix.jps_version }}
path: jupedsim
- name: Building libjupedsim
if: matrix.build_type == 'full' && github.repository == 'DLR-TS/sumo'
run: |
sudo apt-get install libgeos-dev
cmake -B jupedsim-build -DCMAKE_INSTALL_PREFIX=jupedsim-install jupedsim
cmake --build jupedsim-build -j4 --config Release
cmake --install jupedsim-build --config Release
- name: Configuring 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 ..; fi
if [[ "${{ matrix.build_type }}" == "minimal" ]]; then cmake -DFOX_CONFIG= -DPROJ_LIBRARY= -DCHECK_OPTIONAL_LIBS=OFF -DFMI=OFF ..; fi
- name: Building Traas
run: |
cd sumo/cmake-build
make traas
- name: Setting up SonarQube
if: matrix.build_type == 'full' && github.repository == 'eclipse-sumo/sumo' && github.event_name == 'schedule' && matrix.compiler == 'gcc'
uses: warchant/setup-sonar-scanner@v8
- name: Building SUMO with SonarQube wrapper
if: matrix.build_type == 'full' && github.repository == 'eclipse-sumo/sumo' && github.event_name == 'schedule' && matrix.compiler == 'gcc'
run: |
cd sumo/cmake-build
curl -L -O https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip -o build-wrapper-linux-x86.zip
build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make -j4
cd ..
sonar-scanner -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dsonar.cfamily.build-wrapper-output=cmake-build/bw-output
- name: Building and Installing SUMO
if: matrix.build_type != 'full' || github.repository != 'eclipse-sumo/sumo' || github.event_name != 'schedule' || matrix.compiler != 'gcc'
run: |
cd sumo/cmake-build
make -j4
sudo make install
- name: Building Examples and Tests
if: matrix.build_type == 'full' && (github.repository == 'DLR-TS/sumo' || matrix.compiler == 'gcc')
run: |
sudo apt-get install python3-pyproj python3-rtree python3-pandas python3-flake8 python3-autopep8 python3-scipy python3-pulp python3-ezdxf python3-pyperclip python3-polib
python -m pip install -r sumo/tools/req_ci.txt
python -m pip install -r sumo/tools/requirements.txt
cd sumo/cmake-build
make CTEST_OUTPUT_ON_FAILURE=1 examples test
- name: Extra tests
if: matrix.build_type == 'full' && github.repository == 'DLR-TS/sumo'
run: |
sudo apt-get install python2
sumo/tests/runTests.sh -b ci -a sumo.meso.ci,sumo.extra.ci
sumo/tests/runTests.sh -b ci -a netconvert.gdal.ci,polyconvert.gdal.ci
sumo/tests/runTests.sh -b ci -a tools.python2.ci
- 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.compiler }}-${{ matrix.build_type }}
path: texttesttmp.zip
if-no-files-found: warn
- name: Uploading artifacts (SUMO binaries)
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.compiler }}-${{ matrix.build_type }}-binaries
path: sumo/bin