(MOD) Added more steps for project building.

This commit is contained in:
2024-06-25 14:15:17 +08:00
parent 092dddf6c4
commit 55d9ddef39
3 changed files with 16 additions and 7 deletions

View File

@@ -66,16 +66,20 @@ jobs:
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }} -S ${{ github.workspace }}
- name: PreInstall
# Perform pre-installation.
run: ./preinstall
- name: Build - name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: PostInstall
# Perform post-installation.
run: ./postinstall
- name: Test - name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }} working-directory: ${{ steps.strings.outputs.build-output-dir }}
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{ matrix.build_type }} run: ctest --build-config ${{ matrix.build_type }}
- name: Install
# By running "install" script to install project header files and shared object file later on after the compilation.
run: ./install

6
postinstall Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
# Install Compound library.
echo "Installing libcompound:"
cp -v "libcompound.so" "/usr/lib"

View File

@@ -19,6 +19,7 @@ if [ ! -d "$DST" ]; then
mkdir -pv "$DST" mkdir -pv "$DST"
fi fi
# Install project-like headers.
PROJLEN=${#PROJ[*]} PROJLEN=${#PROJ[*]}
echo "======== $PROJLEN projects in total ========" echo "======== $PROJLEN projects in total ========"
@@ -38,11 +39,9 @@ while :; do
echo echo
done done
# Install individual headers.
cp -v "common.h" "const.h" "platform.h"\ cp -v "common.h" "const.h" "platform.h"\
"name.h" "namescope.h" "type.h" "catlog.h"\ "name.h" "namescope.h" "type.h" "catlog.h"\
"attr.h" "registry.h" "class.h" "function.h" "$DST" "attr.h" "registry.h" "class.h" "function.h" "$DST"
echo "Installing libcompound:"
cp -v "libcompound.so" "/usr/lib"
printf "\nDone\n" printf "\nDone\n"