File tree Expand file tree Collapse file tree 9 files changed +38
-39
lines changed
src/lib/exercises/include/exercises/hackerrank/warmup Expand file tree Collapse file tree 9 files changed +38
-39
lines changed Original file line number Diff line number Diff line change 2626 sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
2727 sudo apt-get -y update
2828 sudo apt-get -y install --no-install-recommends --no-install-suggests clang-format
29+ # yamllint enable rule:line-length
30+
31+ - name : Check Tools
32+ run : |
33+ make --version
34+ cmake --version
2935 clang-format --version
30- # yamllint enable rule:line-length
3136
3237 - name : Style Check
3338 run : make test/styling
Original file line number Diff line number Diff line change 8181
8282 - name : Install dependencies
8383 run : |
84- vcpkg --x-wait-for-lock integrate install
85- vcpkg --x-wait-for-lock install
84+ make dependencies
8685
8786 # Initializes the CodeQL tools for scanning.
8887 - name : Initialize CodeQL
@@ -112,12 +111,7 @@ jobs:
112111 shell : bash
113112 run : |
114113 export VCPKG_ROOT=/usr/local/share/vcpkg
115- cmake --preset debug -B build
116- cmake --preset debug \
117- -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
118- -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
119- build
120- cmake --build build --verbose
114+ make build
121115
122116 - name : Perform CodeQL Analysis
123117 uses : github/codeql-action/analyze@v3
Original file line number Diff line number Diff line change @@ -32,19 +32,13 @@ jobs:
3232
3333 - name : Install dependencies
3434 run : |
35- vcpkg --x-wait-for-lock integrate install
36- vcpkg --x-wait-for-lock install
35+ make dependencies
3736
3837 # yamllint disable rule:line-length
3938 - name : Build
4039 run : |
4140 export VCPKG_ROOT=/usr/local/share/vcpkg
42- cmake --preset debug -B build
43- cmake --preset debug \
44- -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
45- -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
46- build
47- cmake --build build --verbose
41+ make build
4842 # yamllint enable rule:line-length
4943
5044 - name : Test / Coverage
Original file line number Diff line number Diff line change @@ -34,19 +34,13 @@ jobs:
3434
3535 - name : Install dependencies
3636 run : |
37- vcpkg --x-wait-for-lock integrate install
38- vcpkg --x-wait-for-lock install
37+ make dependencies
3938
4039 # yamllint disable rule:line-length
4140 - name : Build
4241 run : |
4342 export VCPKG_ROOT=/usr/local/share/vcpkg
44- cmake --preset debug -B build
45- cmake --preset debug \
46- -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
47- -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
48- build
49- cmake --build build --verbose
43+ make build
5044 # yamllint enable rule:line-length
5145
5246 - name : Test
Original file line number Diff line number Diff line change @@ -19,11 +19,22 @@ jobs:
1919 - name : Checkout repository
2020 uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
2121
22- - name : Install dependencies
22+ - name : Install tools
23+ run : |
24+ sudo snap install cppcheck
25+
26+ - name : Check Tools
2327 run : |
24- sudo apt-get update
25- sudo apt-get install cppcheck
28+ make --version
29+ cmake --version
30+ vcpkg --version
2631 cppcheck --version
2732
33+ - name : Install dependencies
34+ run : |
35+ make dependencies
36+
2837 - name : Lint
29- run : make test/static
38+ run : |
39+ export VCPKG_ROOT=/usr/local/share/vcpkg
40+ make test/static
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
1111include (CTest)
1212
1313set (CMAKE_CXX_STANDARD 17)
14- set (CMAKE_CXX_STANDARD_REQUIRED on )
15- set (VCPKG_MANIFEST_INSTALL OFF )
14+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
15+ set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
1616
1717SET (GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0" )
1818SET (GCC_COVERAGE_LINK_FLAGS "--coverage" )
Original file line number Diff line number Diff line change 1010 },
1111 "generator" : " Unix Makefiles" ,
1212 "binaryDir" : " ${sourceDir}/build/default"
13-
1413 }
1514 ]
1615}
Original file line number Diff line number Diff line change @@ -55,9 +55,10 @@ clean:
5555 touch ./coverage/.gitkeep
5656 sh -c " rm -fr -v ./vcpkg_installed" || true
5757
58- build : dependencies
59- cmake --preset debug -B build && \
60- cmake --preset debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 build && \
58+ prebuild : dependencies
59+ cmake --preset debug -B build
60+
61+ build : prebuild
6162 cmake --build build --verbose
6263
6364dependencies :
@@ -72,17 +73,18 @@ lint/yaml:
7273
7374lint : lint/markdown lint/yaml test/styling test/static
7475
75- test/static :
76+ test/static : prebuild
7677 cppcheck \
78+ --project=build/compile_commands.json \
7779 --enable=all \
80+ --check-level=exhaustive \
7881 --std=c++17 \
7982 --library=posix \
8083 --inconclusive \
8184 --inline-suppr \
8285 --error-exitcode=13 \
8386 --suppress=missingIncludeSystem \
84- --showtime=summary \
85- src/
87+ --showtime=summary
8688
8789test/styling :
8890 clang-format --dry-run --Werror $(FILES )
Original file line number Diff line number Diff line change 55
66namespace hackerrank ::warmup {
77std::string miniMaxSumCalculate (const std::vector<int > &arr);
8- void miniMaxSum (const std::vector<int > &ar );
8+ void miniMaxSum (const std::vector<int > &arr );
99} // namespace hackerrank::warmup
You can’t perform that action at this time.
0 commit comments