-
Notifications
You must be signed in to change notification settings - Fork 3
250 lines (203 loc) · 8.59 KB
/
test.yml
File metadata and controls
250 lines (203 loc) · 8.59 KB
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: test
on:
workflow_dispatch:
inputs:
dependencies_artifact_postfix:
description: 'Postfix name to add to artifact name to download dependencies. This is use to download a specific artifact version from eProsima-CI.'
required: true
default: '_nightly'
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
env:
code_packages_names: 'sustainml_cpp sustainml_py sustainml_docs sustainml_modules'
default_dependencies_artifact_postfix: '_nightly'
jobs:
#####################################################################
# TEST
multiplatform-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cmake_build_type:
- Release
- Debug
os:
- ubuntu-22.04
steps:
- name: Free Disk Space
run: |
echo "Disk space before cleanup:"
df -h
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/lib/android/sdk/ndk
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo apt-get clean
echo "Disk space after cleanup:"
df -h
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: ${{ github.workspace }}/src/sustainml_lib
ref: ${{ github.head_ref || github.ref_name }}
- name: Install Fast DDS dependencies
uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@v0
with:
cmake_build_type: ${{ matrix.cmake_build_type }}
- name: Install apt dependencies
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: doxygen graphviz imagemagick python3 python3-pip python3-sphinxcontrib.spelling python3-venv software-properties-common wget clang-tidy curl grep
update: false
upgrade: false
- name: Install Python dependencies
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
with:
packages: colcon-common-extensions colcon-mixin vcstool gcovr==5
upgrade: false
- name: Install Python submodules dependencies
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
with:
requirements_file_name: ${{ github.workspace }}/src/sustainml_lib/sustainml_modules/requirements.txt
upgrade: false
- name: Install ollama
run: curl -fsSL https://ollama.com/install.sh | sh
- name: Fetch SustainML repositories
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}/src/sustainml_lib/sustainml.repos
destination_workspace: ${{ github.workspace }}/src
skip_existing: true
- name: Run ollama
run: |
ollama serve &
ollama pull llama3
- name: Init submodules manually
run: |
cd ${{ github.workspace }}/src/sustainml_lib
git submodule update --init --recursive
- name: Install Java 21
run: |
sudo apt-get update
sudo apt-get install -y openjdk-21-jdk
echo "JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64" >> $GITHUB_ENV
echo "/usr/lib/jvm/java-21-openjdk-amd64/bin" >> $GITHUB_PATH
- name: Install Neo4j
run: |
sudo apt update && sudo apt install -y gnupg ca-certificates wget
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/neo4j.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/neo4j.gpg] https://debian.neo4j.com stable latest" | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt update
sudo apt install -y neo4j
neo4j --version
- name: Load Neo4j backup
run: |
BACKUP_PATH=${{ github.workspace }}/src/sustainml_lib/sustainml_modules/sustainml_modules/sustainml-wp1/rag/neo4j_backup
sudo -E neo4j-admin database load system \
--from-path=$BACKUP_PATH \
--overwrite-destination=true
sudo -E neo4j-admin database load neo4j \
--from-path=$BACKUP_PATH \
--overwrite-destination=true
sudo chown -R neo4j:neo4j /var/lib/neo4j/data
- name: Start Neo4j service
run: |
sudo -E neo4j start
- name: Download Annoy Index file from Google Drive
run: |
pip install gdown
gdown --id 1TQvt1bSXares-I9l7Wki0Jge3oubRkOJ -O ${{ github.workspace }}/src/sustainml_lib/sustainml_modules/sustainml_modules/sustainml-wp1/rag/models_index.ann
- name: Compile and run tests
uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0
with:
ctest_args: '--timeout 300'
packages_names: sustainml_cpp sustainml_py sustainml_modules
cmake_args: -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
colcon_meta_file: ${{ github.workspace }}/src/sustainml_lib/.github/workflows/configurations/${{ runner.os }}/colcon.meta
#####################################################################
# CLANG
clang:
runs-on: ubuntu-24.04
steps:
- name: Free Disk Space
run: |
echo "Disk space before cleanup:"
df -h
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/lib/android/sdk/ndk
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo apt-get clean
echo "Disk space after cleanup:"
df -h
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: ${{ github.workspace }}/src/sustainml_lib
ref: ${{ github.head_ref || github.ref_name }}
- name: Install Fast DDS dependencies
uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@v0
with:
cmake_build_type: ${{ matrix.cmake_build_type }}
- name: Install apt dependencies
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: doxygen graphviz imagemagick python3 python3-pip python3-sphinxcontrib.spelling python3-venv software-properties-common wget clang-tidy curl grep libfreetype6-dev libjpeg-dev libpng-dev zlib1g-dev
update: false
upgrade: false
- name: Install Python dependencies
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
with:
packages: colcon-common-extensions colcon-mixin vcstool gcovr==5
upgrade: false
- name: Install Python documentation dependencies
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
with:
requirements_file_name: ${{ github.workspace }}/src/sustainml_lib/sustainml_docs/requirements.txt
upgrade: false
- name: Install Python submodules dependencies
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
with:
requirements_file_name: ${{ github.workspace }}/src/sustainml_lib/sustainml_modules/requirements.txt
upgrade: false
- name: Install ollama
run: curl -fsSL https://ollama.com/install.sh | sh
- name: Fetch SustainML repositories
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}/src/sustainml_lib/sustainml.repos
destination_workspace: ${{ github.workspace }}/src
skip_existing: true
- name: Run ollama
run: |
ollama serve &
ollama pull llama3
- name: Init submodules manually
run: |
cd ${{ github.workspace }}/src/sustainml_lib
git submodule update --init --recursive
- name: Download file from Google Drive
run: |
pip install gdown
gdown --id 1TQvt1bSXares-I9l7Wki0Jge3oubRkOJ -O ${{ github.workspace }}/src/sustainml_lib/sustainml_modules/sustainml_modules/sustainml-wp1/rag/models_index.ann
- name: Compile and run tests
uses: eProsima/eProsima-CI/multiplatform/clang_build_test@v0
with:
packages_names: ${{ env.code_packages_names }}
colcon_meta_file: ${{ github.workspace }}/src/sustainml_lib/.github/workflows/configurations/Linux/colcon.meta
#####################################################################
# UNCRUSTIFY
uncrustify:
runs-on: ubuntu-24.04
steps:
- name: Uncrustify
uses: eProsima/eProsima-CI/ubuntu/uncrustify@v0