Skip to content

Commit

Permalink
integrate zj-common-scripts as a submodule (#8)
Browse files Browse the repository at this point in the history
* tested

* modularizes scripts

* updates git workflow

* updates workflow name
  • Loading branch information
zongyaojin authored Nov 17, 2023
1 parent d5f3c07 commit 1dee0cf
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 171 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ jobs:
token: ${{ secrets.ZJ_REPO_PAT }}

# Multi-line command | https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Install dependencies
run: bash ./scripts/zj-install-deps.bash
- name: Install common dependencies
run: bash ./scripts/zj-common-scripts/zj-dependencies.bash

- name: Install package dependencies
run: bash ./scripts/zj-package-dependencies.bash

- name: Build, test and install
run: bash ./scripts/zj-build-install-example.bash
run: bash ./scripts/zj-common-scripts/zj-build-install-example.bash

- name: Run client project example
run: bash ./client-project-example/build-run-client-example.bash
- name: Build and run client project example
run: bash ./client-project-example/zj-build-run-client-example.bash

- name: Setup and run pre-commit
run: bash ./scripts/zj-pre-commit.bash
run: bash ./scripts/zj-common-scripts/zj-pre-commit.bash
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "cmake/zj-cmake"]
path = cmake/zj-cmake
url = git@github.com:zongyaojin/zj-cmake.git
[submodule "scripts/zj-common-scripts"]
path = scripts/zj-common-scripts
url = git@github.com:zongyaojin/zj-common-scripts.git
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ This package contains some handy tools such as logging and debugging for C++ pro

See also:

- [Version history](./version-history.md)
- [Create and push tags](https://stackoverflow.com/a/18223354)
- [Delete and push tags](https://stackoverflow.com/a/5480292)
27 changes: 0 additions & 27 deletions client-project-example/build-run-client-example.bash

This file was deleted.

27 changes: 27 additions & 0 deletions client-project-example/zj-build-run-client-example.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -exo pipefail

# Get this script's filename with absolute path
script_file=$(realpath "$0")
# Get this script's absolute path without the filename
script_absolute_path=$(dirname "$script_file")

# Path definitions
build_path=$script_absolute_path/build
zj_package_install_path=$script_absolute_path/install

# Remove the build path for a fresh start
rm -rf $build_path

# Make directories
mkdir -p $build_path

# Go to the build path, build and install
(
cd $build_path
cmake .. \
-D CMAKE_PREFIX_PATH=$zj_package_install_path \
-D CMAKE_BUILD_TYPE=Release
make
./client-project-example
)
33 changes: 0 additions & 33 deletions scripts/zj-build-install-example.bash

This file was deleted.

36 changes: 0 additions & 36 deletions scripts/zj-code-coverage.bash

This file was deleted.

1 change: 1 addition & 0 deletions scripts/zj-common-scripts
Submodule zj-common-scripts added at ab57bb
18 changes: 0 additions & 18 deletions scripts/zj-doxygen.bash

This file was deleted.

27 changes: 0 additions & 27 deletions scripts/zj-install-deps.bash

This file was deleted.

9 changes: 9 additions & 0 deletions scripts/zj-package-dependencies.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -exo pipefail

# Update and install system-level package managment dependencies
sudo apt update -y
sudo apt upgrade -y

# Install package-specific dependencies
sudo apt install -y libgtest-dev libspdlog-dev libeigen3-dev libboost-all-dev
18 changes: 0 additions & 18 deletions scripts/zj-pre-commit.bash

This file was deleted.

5 changes: 0 additions & 5 deletions version-history.md

This file was deleted.

0 comments on commit 1dee0cf

Please sign in to comment.