-
Notifications
You must be signed in to change notification settings - Fork 24
188 lines (165 loc) · 5.47 KB
/
install_test.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
name: Installation Matrix
on:
pull_request:
branches:
- stable
- unstable
schedule:
- cron: '0 23 * * 1'
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
cancel_others: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
build:
name: ${{ matrix.config.name }} ${{matrix.carma_test_mode}}
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
carma_test_mode : ["", "comp_carma", "comp_headers"]
config:
- {
name: "Windows (MSVC)",
os: windows-latest,
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
generators: "Visual Studio 17 2022",
target: "ALL_BUILD"
}
- {
name: "Ubuntu (Clang-14)",
os: ubuntu-latest,
build_type: "Release",
cc: "clang-14",
cxx: "clang++-14",
generators: "Ninja",
target: "all"
}
- {
name: "Ubuntu (GCC-11)",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc-11",
cxx: "g++-11",
generators: "Ninja",
target: "all"
}
- {
name: "macOS (Clang)",
os: macos-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja",
target: "all"
}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install cmake ninja
ninja --version
cmake --version
- name: Install dependencies on ubuntu
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade cmake ninja
ninja --version
cmake --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
python -m pip install cmake ninja
ninja --version
cmake --version
- name: Install python pacakges
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install numpy pytest
- name: Install CARMA
# install with sudo
if: runner.os == 'Linux' || matrix.config.os == 'macos-latest'
run: |
mkdir build
cd build
export PY_CMD=$(python -c 'import sys; print(sys.executable)')
cmake \
-DCARMA_INSTALL_LIB=ON \
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-DPython3_EXECUTABLE=${PY_CMD} \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
..
sudo cmake --build . --config Release --target install
- name: Install CARMA
if: startsWith(matrix.config.os, 'windows')
run: |
mkdir build
cd build
export PY_CMD=$(python -c 'import sys; print(sys.executable)')
cmake \
-DCARMA_INSTALL_LIB=ON \
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-DPython3_EXECUTABLE=${PY_CMD} \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
..
cmake --build . --config Release --target install
- name: Configure
run: |
cd integration_test
mkdir build
cd build
export PY_CMD=$(python -c 'import sys; print(sys.executable)')
cmake \
-DCARMA_INSTALL_LIB=ON \
-DCMAKE_INSTALL_PREFIX:PATH=. \
-DCARMA_TEST_MODE=${{matrix.carma_test_mode}} \
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-DPython3_EXECUTABLE=${PY_CMD} \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
..
- name: Build
run: |
cd integration_test/build
cmake \
--build . \
--target install \
--config ${{ matrix.config.build_type }}
- name: Test
run: |
cd integration_test/build
python -m pytest -v