Skip to content

Commit

Permalink
Fix docker and update linter
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalkah committed Aug 23, 2024
1 parent 3d0ed11 commit 44f740a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake-single-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ jobs:
- name: Run Docker
working-directory: ${{github.workspace}}/docker
run: |
bash run.sh
bash test.sh
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
find . -not -path "./.git/*" -not -path "./.vscode/*" -name "*.cpp" -o -name "*.h" | xargs clang-format -i -style=file
# commit the changes (if there are any)
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4.16.0
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 🎨 apply clang-format changes
branch: ${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

cd path-planning/build
./main
ctest -C --verbose
40 changes: 40 additions & 0 deletions docker/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

RED='\033[0;31m' # red
GREEN='\033[0;32m' # green
YELLOW='\033[1;33m' # yellow
BLUE='\033[1;34m' # blue
CYAN='\033[1;36m' # cyan
NC='\033[0m' # no color

IMAGE_NAME="path_planning:latest"
CONTAINER_NAME=planning

XSOCK=/tmp/.X11-unix
XAUTH=$HOME/.Xauthority

VOLUMES="--volume=$XSOCK:$XSOCK:rw
--volume=$XAUTH:$XAUTH:rw"

if (docker ps --all | grep -q ${CONTAINER_NAME})
then
printf "${GREEN}---DOCKER CONTAINER IS VALID---\n${NC}"
if (docker ps | grep -q ${CONTAINER_NAME})
then
printf "${YELLOW}---OPENNING DOCKER CONTAINER---\n${NC}"
docker exec ${CONTAINER_NAME} /bin/bash
else
printf "${YELLOW}---STARTING DOCKER CONTAINER---\n${NC}"
docker start ${CONTAINER_NAME} 1>/dev/null 2>&1
docker exec ${CONTAINER_NAME} /bin/bash
fi
else
printf "${RED}---CREATING DOCKER CONTAINER---\n${NC}"
docker run \
--rm \
--net=host \
--privileged \
$VOLUMES \
--name="${CONTAINER_NAME}" \
$IMAGE_NAME
fi

0 comments on commit 44f740a

Please sign in to comment.