Skip to content

Commit 7c93ae9

Browse files
committed
Add CI for Ubuntu 24.04
1 parent bfe84de commit 7c93ae9

File tree

8 files changed

+118
-6
lines changed

8 files changed

+118
-6
lines changed

.github/scripts/ubuntu-22.04/download_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
mkdir -p "${DOWNLOAD_PATH}"
66

7-
## Thrift 0.16 + ODB beta
7+
## ODB
88

99
wget -O "${DOWNLOAD_PATH}/install_latest_build2.sh" "https://github.com/Ericsson/CodeCompass/raw/master/scripts/install_latest_build2.sh"
1010
build2_version=$(sh "${DOWNLOAD_PATH}/install_latest_build2.sh" --version)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# Compile dependencies that cannot be acquired via the official repositories
4+
5+
mkdir -p ${INSTALL_PATH}
6+
7+
## Compile Thrift
8+
9+
tar -xvf ${DOWNLOAD_PATH}/thrift-0.16.0.tar.gz
10+
cd thrift-0.16.0
11+
./configure --prefix=${INSTALL_PATH}/thrift --silent --without-python \
12+
--enable-libtool-lock --enable-tutorial=no --enable-tests=no \
13+
--with-libevent --with-zlib --without-nodejs --without-lua \
14+
--without-ruby --without-csharp --without-erlang --without-perl \
15+
--without-php --without-php_extension --without-dart \
16+
--without-haskell --without-go --without-rs --without-haxe \
17+
--without-dotnetcore --without-d --without-qt4 --without-qt5 \
18+
--without-java --without-swift
19+
20+
make install -j $(nproc)
21+
22+
## Compile build2
23+
24+
sh "${DOWNLOAD_PATH}/install_latest_build2.sh" ${INSTALL_PATH}/build2
25+
26+
## Compile odb, libodb, and its connectors
27+
28+
mkdir -p ${DOWNLOAD_PATH}/odb
29+
cd ${DOWNLOAD_PATH}/odb
30+
${INSTALL_PATH}/build2/bin/bpkg create --quiet --jobs $(nproc) cc \
31+
config.cxx=g++ \
32+
config.cc.coptions=-O3 \
33+
config.bin.rpath=${INSTALL_PATH}/odb/lib \
34+
config.install.root=${INSTALL_PATH}/odb
35+
36+
### Getting the source
37+
${INSTALL_PATH}/build2/bin/bpkg add https://pkg.cppget.org/1/beta --trust-yes
38+
${INSTALL_PATH}/build2/bin/bpkg fetch --trust-yes
39+
40+
### Building odb
41+
${INSTALL_PATH}/build2/bin/bpkg build odb --yes
42+
${INSTALL_PATH}/build2/bin/bpkg build libodb --yes
43+
${INSTALL_PATH}/build2/bin/bpkg build libodb-sqlite --yes
44+
${INSTALL_PATH}/build2/bin/bpkg build libodb-pgsql --yes
45+
${INSTALL_PATH}/build2/bin/bpkg install --all --recursive
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Download installers for compiled dependencies
4+
5+
mkdir -p "${DOWNLOAD_PATH}"
6+
7+
## Thrift 0.16
8+
9+
wget -O ${DOWNLOAD_PATH}/thrift-0.16.0.tar.gz "http://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz"
10+
11+
## ODB
12+
13+
wget -O "${DOWNLOAD_PATH}/install_latest_build2.sh" "https://github.com/Ericsson/CodeCompass/raw/master/scripts/install_latest_build2.sh"
14+
build2_version=$(sh "${DOWNLOAD_PATH}/install_latest_build2.sh" --version)
15+
odb_signature=$(wget -qO- https://pkg.cppget.org/1/beta/signature.manifest)
16+
odb_hash=$(echo -n "${build2_version}${odb_signature}" | md5sum | awk '{print $1}')
17+
18+
# Calculate hash of dependencies for Github Cache Action
19+
20+
dependencies_to_hash=("thrift-0.16.0.tar.gz")
21+
22+
concatenated_hashes=""
23+
for file in "${dependencies_to_hash[@]}"; do
24+
file_hash=$(md5sum "${DOWNLOAD_PATH}/${file}" | awk '{print $1}')
25+
concatenated_hashes="${concatenated_hashes}${file_hash}"
26+
done
27+
concatenated_hashes="${concatenated_hashes}${odb_hash}"
28+
29+
hash_value=$(echo -n "${concatenated_hashes}" | md5sum | awk '{print $1}')
30+
31+
## Save said hash
32+
33+
### Restore action
34+
echo "compile-hash-key=${hash_value}" >> "$GITHUB_OUTPUT"
35+
36+
### Save action
37+
echo "CACHE_KEY=${hash_value}" >> "$GITHUB_ENV"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Post compilation configuration for building (environmental variables, library location settings etc..)
4+
5+
echo "${INSTALL_PATH}/thrift/bin" >> $GITHUB_PATH
6+
echo "CMAKE_PREFIX_PATH=${INSTALL_PATH}/thrift:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
7+
8+
echo "${INSTALL_PATH}/odb/bin" >> $GITHUB_PATH
9+
echo "CMAKE_PREFIX_PATH=${INSTALL_PATH}/odb:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
10+
11+
# Clean up dependency sources and intermediate binaries to save space
12+
rm -f ${DOWNLOAD_PATH}/thrift-0.16.0.tar.gz
13+
rm -rf ${DOWNLOAD_PATH}/thrift-0.16.0/
14+
15+
rm -rf ${DOWNLOAD_PATH}/odb
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Install required packages for CodeCompass build
4+
sudo apt install git cmake make g++ libboost-all-dev \
5+
llvm-15-dev clang-15 libclang-15-dev \
6+
default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
7+
libldap2-dev libgtest-dev
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Install PostgreSQL
4+
sudo apt-get install postgresql-server-dev-16
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Install SQLite3
4+
sudo apt-get install libsqlite3-dev

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
strategy:
1818
matrix:
1919
db: [postgresql, sqlite3]
20-
os: [ubuntu-22.04]
20+
os: [ubuntu-22.04, ubuntu-24.04]
2121
fail-fast: false
2222

2323
runs-on: ${{ matrix.os }}
2424
outputs:
25-
ubuntu-20-04-compile-hash-key: ${{ steps.download-compile-dependencies.outputs.compile-hash-key }}
26-
ubuntu-22-04-compile-hash-key: ${{ steps.download-compile-dependencies.outputs.compile-hash-key }} # update this to 24.04 later
25+
ubuntu-24-04-compile-hash-key: ${{ steps.download-compile-dependencies.outputs.compile-hash-key }}
26+
ubuntu-22-04-compile-hash-key: ${{ steps.download-compile-dependencies.outputs.compile-hash-key }}
2727

2828
services:
2929
# Label used to access the service container
@@ -182,7 +182,7 @@ jobs:
182182
strategy:
183183
matrix:
184184
db: [postgresql, sqlite3]
185-
os: [ubuntu-22.04]
185+
os: [ubuntu-22.04, ubuntu-24.04]
186186
fail-fast: false
187187

188188
runs-on: ${{ matrix.os }}
@@ -237,7 +237,7 @@ jobs:
237237
fail-on-cache-miss: true
238238
key: ${{ matrix.os }}-compile-install-${{ needs.build.outputs.ubuntu-22-04-compile-hash-key }}
239239
restore-keys: |
240-
${{ matrix.os }}-compile-install-${{ needs.build.outputs.ubuntu-20-04-compile-hash-key }}
240+
${{ matrix.os }}-compile-install-${{ needs.build.outputs.ubuntu-24-04-compile-hash-key }}
241241
${{ matrix.os }}-compile-install-${{ needs.build.outputs.ubuntu-22-04-compile-hash-key }}
242242
243243
- name: Download CodeCompass binaries

0 commit comments

Comments
 (0)