Skip to content

Commit

Permalink
Add CMake build to CI checks
Browse files Browse the repository at this point in the history
  • Loading branch information
DownerCase committed Nov 12, 2024
1 parent 67dde7e commit 03d0bd0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
25 changes: 22 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,38 @@ RUN cmake --install ./out/core/build --strip --component configuration \
&& cmake --install ./out/core/build --strip --component sdk

###
# Dev build-stage, for consuming eCAL and building/testing the Go code
# Dev base build-stage, for consuming eCAL
###
FROM ${BASE_IMAGE} AS dev
FROM ${BASE_IMAGE} AS dev-base

LABEL org.opencontainers.image.source https://github.com/downercase/ecal-go

RUN apt-get update && apt-get install --no-install-recommends -y\
g++ \
golang \
libyaml-cpp0.8 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /ecal/staging /usr/local

# Update dynamic linker so it knows about our new libraries
RUN ldconfig

###
# Dev build-stage, for consuming eCAL and building/testing the C interface library
###
FROM dev-base AS dev-cpp

RUN apt-get update && apt-get install --no-install-recommends -y\
cmake \
ninja-build \
&& rm -rf /var/lib/apt/lists/*

###
# Dev build-stage, for consuming eCAL and building/testing the Go code
###
FROM dev-base AS dev-go

RUN apt-get update && apt-get install --no-install-recommends -y\
golang \
&& rm -rf /var/lib/apt/lists/*

14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,17 @@ jobs:

- name: Test
run: go test -v ./...

cmake:
container:
image: ghcr.io/downercase/ecal-go-cpp:latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Configure
run: cmake -S . -B build -G Ninja -Werror=dev -DCMAKE_COMPILE_WARNING_AS_ERROR=ON

- name: Build
run: cmake --build ./build

8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ find_package(eCAL CONFIG REQUIRED)

add_library(ecal_go_core)
target_sources(ecal_go_core PRIVATE
./ecal/ecal_go_core.h
./ecal/ecal_go_core.cpp
./ecal/core.h
./ecal/core.cpp
)
target_link_libraries(ecal_go_core PRIVATE eCAL::core)

add_library(ecal_go_publisher)
target_sources(ecal_go_publisher PRIVATE
./ecal/publisher/ecal_go_publisher.h
./ecal/publisher/ecal_go_publisher.cpp
./ecal/publisher/publisher.h
./ecal/publisher/publisher.cpp
)
target_link_libraries(ecal_go_publisher PRIVATE eCAL::core)

Expand Down

0 comments on commit 03d0bd0

Please sign in to comment.