1+ # # NOTE:
2+ # # This file was initially generated with the assistance of AI.
3+ # # The code has been reviewed and may have been modified by the developer
4+ # # to ensure correctness, readability, and compliance with project requirements.
5+ #! /usr/bin/env bash
6+
7+ set -e # Exit immediately if a command fails
8+
9+ PROJECT_EXEC=" ./build/cpp_lab_project"
10+ BUILD_DIR=" ./build"
11+
12+ clear
13+ echo " =============================="
14+ echo " Starting build pipeline... "
15+ echo " =============================="
16+
17+ # Check required tools
18+ for tool in cmake cppcheck python3; do
19+ if ! command -v $tool & > /dev/null; then
20+ echo " [ERR]: $tool is not installed."
21+ exit 1
22+ fi
23+ done
24+
25+ echo " "
26+ echo " ===========>> Building project..."
27+ cmake --build " $BUILD_DIR "
28+
29+ echo " "
30+ echo " ===========>> Running cppcheck..."
31+ cppcheck \
32+ --enable=warning,style,performance,portability \
33+ --inconclusive \
34+ --inline-suppr \
35+ --quiet \
36+ --error-exitcode=1 \
37+ ./src ./include
38+
39+ echo " [OK] Static analysis passed"
40+
41+ echo " "
42+ echo " ===========>> Generating commit id..."
43+ python3 ./private/genid.py
44+
45+ echo " "
46+ echo " ===========>> Running program..."
47+ if [ -f " $PROJECT_EXEC " ]; then
48+ " $PROJECT_EXEC "
49+ else
50+ echo " [ERR] Executable not found: $PROJECT_EXEC "
51+ exit 1
52+ fi
53+
54+ echo " "
55+ echo " =============================="
56+ echo " Pipeline finished successfully!"
57+ echo " =============================="
0 commit comments