Skip to content

Commit

Permalink
working maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
filippobrizzi committed Jan 31, 2024
1 parent eef6f04 commit 2b33533
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 14 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.cache/
.git/
.vscode/
build/

Expand Down
31 changes: 25 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,37 @@ jobs:
docker login --username filippobrizzi --password ${{ secrets.GH_PAT }} ghcr.io
cd ${{github.workspace}}/docker
./build.sh
source ./version.sh
docker image tag ${IMAGE}:latest ghcr.io/filippobrizzi/${IMAGE}:latest
docker push ghcr.io/filippobrizzi/${IMAGE}:latest
build:
./publish.sh
docker_deps_build_and_publish:
needs: docker_build_and_publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
external:
- 'external/**'
- name: Build and push the image
if: steps.filter.outputs.external == 'true'
run: |
docker login --username filippobrizzi --password ${{ secrets.GH_PAT }} ghcr.io
cd ${{github.workspace}}/docker
./build_dev.sh
./publish_dev.sh
build:
needs: docker_deps_build_and_publish
# TODO: use the docker image published at the step over
runs-on: ubuntu-latest
container:
image: ghcr.io/filippobrizzi/eolo-dev_deps:latest
credentials:
username: ${{ github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: sudo apt update && sudo apt install -y ninja-build

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"toolchainFile": "${sourceDir}/toolchains/toolchain_clang.cmake",
"cacheVariables": {
"BUILD_MODULES": "all",
"DENABLE_LINTER": "OFF",
"ENABLE_LINTER": "OFF",
"CMAKE_BUILD_TYPE": "Release"
}
}
Expand Down
10 changes: 6 additions & 4 deletions docker/Dockerfile_deps
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

SHELL ["/bin/bash", "-c"]

COPY . /tmp/eolo/
RUN ls /tmp/eolo/

RUN mkdir /tmp/build
WORKDIR /tmp/build
RUN cmake ../eolo/ --preset docker
RUN mkdir /tmp/eolo/build
WORKDIR /tmp/eolo/build
RUN . "$HOME/.cargo/env" && cmake ../ --preset docker
RUN ninja all && \
ninja install

RUN cd ../ && rm -rf eolo && rm -rf build
RUN cd / && rm -rf /tmp/eolo
4 changes: 3 additions & 1 deletion docker/build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ SUFFIX=deps

pushd ../

docker build . -t ${IMAGE}_${SUFFIX}:${VERSION} -f docker/Dockerfile_deps --cpuset-cpus "0-$ncores" --build-arg BASE_IMAGE=${IMAGE}:${VERSION} --build-arg CODEBASE=${CODEBASE} --progress=plain --no-cache
BASE_IMAGE=ghcr.io/filippobrizzi/${IMAGE}:${VERSION}
docker pull ${BASE_IMAGE}
docker build . -t ${IMAGE}_${SUFFIX}:${VERSION} -f docker/Dockerfile_deps --cpuset-cpus "0-$ncores" --build-arg BASE_IMAGE=${BASE_IMAGE} --tag ${IMAGE}_${SUFFIX}:latest

popd
4 changes: 2 additions & 2 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ if(zenohcxx IN_LIST EXTERNAL_PROJECTS_LIST)
message(STATUS "zenohc: Building ${zenohc_VERION_REQUIRED} from source")
ExternalProject_Add(
zenohc
DEPENDS zenohd
DEPENDS zenohd
GIT_REPOSITORY "https://github.com/eclipse-zenoh/zenoh-c.git"
GIT_TAG 408a6eb2f305c965101f19f6925acc0e0a93f764 # v${zenohc_VERION_REQUIRED}
GIT_TAG d1ec83dee421054bed034e0e60abc98a526bae0a # v${zenohc_VERION_REQUIRED}
GIT_SHALLOW true
CMAKE_ARGS ${EP_CMAKE_EXTRA_ARGS} -DCMAKE_VERBOSE_MAKEFILE=ON)
endif()
Expand Down

0 comments on commit 2b33533

Please sign in to comment.