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 26
26
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
27
27
sudo apt-get -y update
28
28
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
29
35
clang-format --version
30
- # yamllint enable rule:line-length
31
36
32
37
- name : Style Check
33
38
run : make test/styling
Original file line number Diff line number Diff line change 81
81
82
82
- name : Install dependencies
83
83
run : |
84
- vcpkg --x-wait-for-lock integrate install
85
- vcpkg --x-wait-for-lock install
84
+ make dependencies
86
85
87
86
# Initializes the CodeQL tools for scanning.
88
87
- name : Initialize CodeQL
@@ -112,12 +111,7 @@ jobs:
112
111
shell : bash
113
112
run : |
114
113
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
121
115
122
116
- name : Perform CodeQL Analysis
123
117
uses : github/codeql-action/analyze@v3
Original file line number Diff line number Diff line change @@ -32,19 +32,13 @@ jobs:
32
32
33
33
- name : Install dependencies
34
34
run : |
35
- vcpkg --x-wait-for-lock integrate install
36
- vcpkg --x-wait-for-lock install
35
+ make dependencies
37
36
38
37
# yamllint disable rule:line-length
39
38
- name : Build
40
39
run : |
41
40
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
48
42
# yamllint enable rule:line-length
49
43
50
44
- name : Test / Coverage
Original file line number Diff line number Diff line change @@ -34,19 +34,13 @@ jobs:
34
34
35
35
- name : Install dependencies
36
36
run : |
37
- vcpkg --x-wait-for-lock integrate install
38
- vcpkg --x-wait-for-lock install
37
+ make dependencies
39
38
40
39
# yamllint disable rule:line-length
41
40
- name : Build
42
41
run : |
43
42
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
50
44
# yamllint enable rule:line-length
51
45
52
46
- name : Test
Original file line number Diff line number Diff line change @@ -19,11 +19,22 @@ jobs:
19
19
- name : Checkout repository
20
20
uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
21
21
22
- - name : Install dependencies
22
+ - name : Install tools
23
+ run : |
24
+ sudo snap install cppcheck
25
+
26
+ - name : Check Tools
23
27
run : |
24
- sudo apt-get update
25
- sudo apt-get install cppcheck
28
+ make --version
29
+ cmake --version
30
+ vcpkg --version
26
31
cppcheck --version
27
32
33
+ - name : Install dependencies
34
+ run : |
35
+ make dependencies
36
+
28
37
- 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")
11
11
include (CTest )
12
12
13
13
set (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 )
16
16
17
17
SET (GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0" )
18
18
SET (GCC_COVERAGE_LINK_FLAGS "--coverage" )
Original file line number Diff line number Diff line change 10
10
},
11
11
"generator" : " Unix Makefiles" ,
12
12
"binaryDir" : " ${sourceDir}/build/default"
13
-
14
13
}
15
14
]
16
15
}
Original file line number Diff line number Diff line change @@ -55,9 +55,10 @@ clean:
55
55
touch ./coverage/.gitkeep
56
56
sh -c " rm -fr -v ./vcpkg_installed" || true
57
57
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
61
62
cmake --build build --verbose
62
63
63
64
dependencies :
@@ -72,17 +73,18 @@ lint/yaml:
72
73
73
74
lint : lint/markdown lint/yaml test/styling test/static
74
75
75
- test/static :
76
+ test/static : prebuild
76
77
cppcheck \
78
+ --project=build/compile_commands.json \
77
79
--enable=all \
80
+ --check-level=exhaustive \
78
81
--std=c++17 \
79
82
--library=posix \
80
83
--inconclusive \
81
84
--inline-suppr \
82
85
--error-exitcode=13 \
83
86
--suppress=missingIncludeSystem \
84
- --showtime=summary \
85
- src/
87
+ --showtime=summary
86
88
87
89
test/styling :
88
90
clang-format --dry-run --Werror $(FILES )
Original file line number Diff line number Diff line change 5
5
6
6
namespace hackerrank ::warmup {
7
7
std::string miniMaxSumCalculate (const std::vector<int > &arr);
8
- void miniMaxSum (const std::vector<int > &ar );
8
+ void miniMaxSum (const std::vector<int > &arr );
9
9
} // namespace hackerrank::warmup
You can’t perform that action at this time.
0 commit comments