From fe494f4aaaa39f8fa8dcd7b95274347e6976aa9a Mon Sep 17 00:00:00 2001 From: minhanghuang Date: Fri, 8 Mar 2024 11:28:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(script):=20=E8=A7=A3=E5=86=B3=E5=AE=89?= =?UTF-8?q?=E8=A3=85Protobuf=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98[https://g?= =?UTF-8?q?ithub.com/minhanghuang/CyberRT/issues/51]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- install.py | 28 +++++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 08a005f..0e25c6c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ cd CyberRT > install ```shell -sudo python install.py +sudo python3 install.py ``` > export path diff --git a/install.py b/install.py index cff361b..c1c9f52 100644 --- a/install.py +++ b/install.py @@ -48,7 +48,7 @@ def _clone_setup(self): "--depth=1" ) os.chdir(os.path.join(self._dowload_path, "setup")) - self._cmd("mkdir -p build && cd build") + self._cmd("mkdir -p build") os.chdir("build") self._cmd( "cmake -DCMAKE_INSTALL_PREFIX={} ..".format(self._install_prefix)) @@ -62,7 +62,7 @@ def _clone_nlohmann_json(self): "--depth=1" ) os.chdir(os.path.join(self._dowload_path, "nlohmann_json")) - self._cmd("mkdir -p build && cd build") + self._cmd("mkdir -p build") os.chdir("build") self._cmd( "cmake -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format(self._install_prefix)) @@ -78,7 +78,7 @@ def _clone_tinyxml2(self): "--depth=1" ) os.chdir(os.path.join(self._dowload_path, "tinyxml2")) - self._cmd("mkdir -p build && cd build") + self._cmd("mkdir -p build") os.chdir("build") self._cmd( "cmake -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format(self._install_prefix)) @@ -116,16 +116,16 @@ def _clone_gfamily(self): ) os.chdir(os.path.join(self._dowload_path, "gflags")) - self._cmd("mkdir -p build && cd build") + self._cmd("mkdir -p build") os.chdir("build") self._cmd( "cmake -DCMAKE_CXX_FLAGS='-fPIC' -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format( self._install_prefix)) - self._cmd("sudo make install -j$(nproc)") + self._cmd("make install -j$(nproc)") os.chdir(self._current_path) os.chdir(os.path.join(self._dowload_path, "glog")) - self._cmd("mkdir -p build && cd build") + self._cmd("mkdir -p build") os.chdir("build") self._cmd( "cmake -DCMAKE_CXX_FLAGS='-fPIC' -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format( @@ -134,7 +134,7 @@ def _clone_gfamily(self): os.chdir(self._current_path) os.chdir(os.path.join(self._dowload_path, "googletest")) - self._cmd("mkdir -p build && cd build") + self._cmd("mkdir -p build") os.chdir("build") self._cmd( "cmake -DCMAKE_CXX_FLAGS='-fPIC -w' -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format( @@ -143,7 +143,17 @@ def _clone_gfamily(self): os.chdir(self._current_path) os.chdir(os.path.join(self._dowload_path, "glog")) - self._cmd("mkdir -p build && cd build") + self._cmd("mkdir -p build") + os.chdir("build") + self._cmd( + "cmake -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX={} ..".format( + self._install_prefix)) + self._cmd("make install -j$(nproc)") + os.chdir(self._current_path) + + os.chdir(os.path.join(self._dowload_path, "protobuf")) + os.chdir("cmake") + self._cmd("mkdir -p build") os.chdir("build") self._cmd( "cmake -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX={} ..".format( @@ -163,7 +173,7 @@ def _clone_dds(self): # self._cmd("git submodule update --init") # self._cmd("patch -p1 < {}".format(os.path.join(self._current_path, # "scripts/FastRTPS_1.5.0.patch"))) - # self._cmd("mkdir -p build && cd build") + # self._cmd("mkdir -p build") # self._cmd( # "cmake -DEPROSIMA_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX={} ..".format( # self._install_prefix)) From 027b47f18608adffdd4675e75a4159bef7221a6d Mon Sep 17 00:00:00 2001 From: minhanghuang Date: Fri, 8 Mar 2024 11:30:17 +0800 Subject: [PATCH 2/3] chore(CI): used install.py to install dependencies --- .github/workflows/ubuntu-latest-v9.0.0-build.yaml | 2 +- .github/workflows/ubuntu18-arrch64-v9.0.0-build.yaml | 2 +- .github/workflows/ubuntu18-v9.0.0-build.yaml | 2 +- .github/workflows/ubuntu20-arrch64-v9.0.0-build.yaml | 2 +- .github/workflows/ubuntu20-v9.0.0-build.yaml | 2 +- .github/workflows/ubuntu22-arrch64-v9.0.0-build.yaml | 2 +- .github/workflows/ubuntu22-v9.0.0-build.yaml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ubuntu-latest-v9.0.0-build.yaml b/.github/workflows/ubuntu-latest-v9.0.0-build.yaml index 355f31e..0b9ff7a 100644 --- a/.github/workflows/ubuntu-latest-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu-latest-v9.0.0-build.yaml @@ -22,7 +22,7 @@ jobs: run: | apt update apt install -y lsb-release git wget pkg-config g++ cmake libpoco-dev uuid-dev libncurses5-dev python3-dev - cd /workspace/${{ github.repository }} && ./scripts/install.sh + cd /workspace/${{ github.repository }} && python3 install.py - name: Build run: | diff --git a/.github/workflows/ubuntu18-arrch64-v9.0.0-build.yaml b/.github/workflows/ubuntu18-arrch64-v9.0.0-build.yaml index 1fa8e05..4028583 100644 --- a/.github/workflows/ubuntu18-arrch64-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu18-arrch64-v9.0.0-build.yaml @@ -33,4 +33,4 @@ jobs: uname -a lsb_release -a echo "-----------------------" - bash -c "./scripts/install.sh && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)" + bash -c "python3 install.py && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)" diff --git a/.github/workflows/ubuntu18-v9.0.0-build.yaml b/.github/workflows/ubuntu18-v9.0.0-build.yaml index eb8e0c1..c755fd6 100644 --- a/.github/workflows/ubuntu18-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu18-v9.0.0-build.yaml @@ -27,7 +27,7 @@ jobs: run: | apt update apt install -y lsb-release git wget pkg-config g++ cmake libpoco-dev uuid-dev libncurses5-dev python3-dev - cd /workspace/${{ github.repository }} && ./scripts/install.sh + cd /workspace/${{ github.repository }} && python3 install.py - name: Build run: | diff --git a/.github/workflows/ubuntu20-arrch64-v9.0.0-build.yaml b/.github/workflows/ubuntu20-arrch64-v9.0.0-build.yaml index c882a48..febe0e5 100644 --- a/.github/workflows/ubuntu20-arrch64-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu20-arrch64-v9.0.0-build.yaml @@ -33,4 +33,4 @@ jobs: uname -a lsb_release -a echo "-----------------------" - bash -c "./scripts/install.sh && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)" + bash -c "python3 install.py && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)" diff --git a/.github/workflows/ubuntu20-v9.0.0-build.yaml b/.github/workflows/ubuntu20-v9.0.0-build.yaml index 416f37d..4d95043 100644 --- a/.github/workflows/ubuntu20-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu20-v9.0.0-build.yaml @@ -22,7 +22,7 @@ jobs: run: | apt update apt install -y lsb-release git wget pkg-config g++ cmake libpoco-dev uuid-dev libncurses5-dev python3-dev - cd /workspace/${{ github.repository }} && ./scripts/install.sh + cd /workspace/${{ github.repository }} && python3 install.py - name: Build run: | diff --git a/.github/workflows/ubuntu22-arrch64-v9.0.0-build.yaml b/.github/workflows/ubuntu22-arrch64-v9.0.0-build.yaml index 10d7cff..72520ae 100644 --- a/.github/workflows/ubuntu22-arrch64-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu22-arrch64-v9.0.0-build.yaml @@ -33,4 +33,4 @@ jobs: uname -a lsb_release -a echo "-----------------------" - bash -c "./scripts/install.sh && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)" + bash -c "python3 install.py && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)" diff --git a/.github/workflows/ubuntu22-v9.0.0-build.yaml b/.github/workflows/ubuntu22-v9.0.0-build.yaml index d7048ff..d42cb55 100644 --- a/.github/workflows/ubuntu22-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu22-v9.0.0-build.yaml @@ -22,7 +22,7 @@ jobs: run: | apt update apt install -y lsb-release git wget pkg-config g++ cmake libpoco-dev uuid-dev libncurses5-dev python3-dev - cd /workspace/${{ github.repository }} && ./scripts/install.sh + cd /workspace/${{ github.repository }} && python3 install.py - name: Build run: | From 28f01a1e7f539b1838fb08e939e469870e7fe238 Mon Sep 17 00:00:00 2001 From: minhanghuang Date: Fri, 8 Mar 2024 12:00:02 +0800 Subject: [PATCH 3/3] chore(CI): update --- .github/workflows/ubuntu-latest-v9.0.0-build.yaml | 4 ++++ .github/workflows/ubuntu18-v9.0.0-build.yaml | 5 +++++ .github/workflows/ubuntu20-v9.0.0-build.yaml | 4 ++++ .github/workflows/ubuntu22-v9.0.0-build.yaml | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/.github/workflows/ubuntu-latest-v9.0.0-build.yaml b/.github/workflows/ubuntu-latest-v9.0.0-build.yaml index 0b9ff7a..8ae67ac 100644 --- a/.github/workflows/ubuntu-latest-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu-latest-v9.0.0-build.yaml @@ -3,6 +3,10 @@ run-name: CyberRT v9.0.0 build runner on ubuntu latest x86-64🚀 on: push: + paths: + - '.github/workflows/ubuntu-latest-v9.0.0-build.yaml' + + pull_request: branches: - v9.0.0 diff --git a/.github/workflows/ubuntu18-v9.0.0-build.yaml b/.github/workflows/ubuntu18-v9.0.0-build.yaml index c755fd6..0a78797 100644 --- a/.github/workflows/ubuntu18-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu18-v9.0.0-build.yaml @@ -11,6 +11,11 @@ on: - 'scripts/**' - '.github/workflows/ubuntu18-v9.0.0-build.yaml' + pull_request: + branches: + - v9.0.0 + + jobs: build-amd-ubuntu18: runs-on: ubuntu-latest diff --git a/.github/workflows/ubuntu20-v9.0.0-build.yaml b/.github/workflows/ubuntu20-v9.0.0-build.yaml index 4d95043..1bceaf8 100644 --- a/.github/workflows/ubuntu20-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu20-v9.0.0-build.yaml @@ -3,6 +3,10 @@ run-name: CyberRT v9.0.0 build runner on ubuntu20 x86-64🚀 on: push: + paths: + - '.github/workflows/ubuntu20-v9.0.0-build.yaml' + + pull_request: branches: - v9.0.0 diff --git a/.github/workflows/ubuntu22-v9.0.0-build.yaml b/.github/workflows/ubuntu22-v9.0.0-build.yaml index d42cb55..7e36422 100644 --- a/.github/workflows/ubuntu22-v9.0.0-build.yaml +++ b/.github/workflows/ubuntu22-v9.0.0-build.yaml @@ -3,6 +3,10 @@ run-name: CyberRT v9.0.0 build runner on ubuntu22 x86-64🚀 on: push: + paths: + - '.github/workflows/ubuntu22-v9.0.0-build.yaml' + + pull_request: branches: - v9.0.0