Fix build
Some checks failed
dropshell-build / build (push) Failing after 10s

This commit is contained in:
j842 2025-06-10 16:06:28 +12:00
parent 95772be1a5
commit 8b26f93683
4 changed files with 20 additions and 10 deletions

View File

@ -3,18 +3,25 @@
set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT="ipdemo" # Define your project name here
export CMAKE_BUILD_TYPE="Debug"
rm -rf "${SCRIPT_DIR}/output"
mkdir -p "${SCRIPT_DIR}/output"
PROJECT="ipdemo"
docker build \
--no-cache \
-t "gitea.jde.nz/public/${PROJECT}-build:latest" \
-f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \
--build-arg PROJECT="${PROJECT}" \
--output "${SCRIPT_DIR}/output" \
"${SCRIPT_DIR}/tests/${PROJECT}"
PROJECT="test_libs"
docker build \
-t "gitea.jde.nz/public/${PROJECT}-build:latest" \
-f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \
--build-arg PROJECT="${PROJECT}" \
--output "${SCRIPT_DIR}/output" \
"${SCRIPT_DIR}/tests/${PROJECT}"

View File

@ -6,14 +6,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo "Building and testing test_libs..."
# Build test_libs
docker run --rm \
-v "${SCRIPT_DIR}/tests:/tests" \
-v "${SCRIPT_DIR}/output:/output" \
-w /tests/test_libs \
gitea.jde.nz/public/dropshell-build-base:latest \
sh -c "mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make && cp test_libs /output/"
# Run test_libs
if [ -f "${SCRIPT_DIR}/output/test_libs" ]; then
echo "Running test_libs..."

View File

@ -17,6 +17,14 @@ find_package(Threads REQUIRED)
# Find SQLite3 using pkg-config as fallback
pkg_check_modules(SQLite3 REQUIRED sqlite3)
# Add custom target to run cmake_prebuild.sh at the start of the build process
add_custom_target(run_prebuild_script ALL
COMMAND ${CMAKE_COMMAND} -E echo "Running cmake_prebuild.sh..."
COMMAND ${CMAKE_COMMAND} -E env bash ${CMAKE_CURRENT_SOURCE_DIR}/cmake_prebuild.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_executable(test_libs test_libs.cpp)
target_link_libraries(test_libs

View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "cmake_prebuild.sh complete."