Skip to content

Commit 12b920b

Browse files
authored
Merge pull request #36 from sir-gon/develop
Develop
2 parents 7911451 + 229048d commit 12b920b

File tree

9 files changed

+38
-39
lines changed

9 files changed

+38
-39
lines changed

.github/workflows/clang-format.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ jobs:
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

.github/workflows/codeql.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ jobs:
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

.github/workflows/cpp-coverage.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/cpp.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/cppcheck.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff 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

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
1111
include(CTest)
1212

1313
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)
1616

1717
SET(GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0")
1818
SET(GCC_COVERAGE_LINK_FLAGS "--coverage")

CMakePresets.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
},
1111
"generator": "Unix Makefiles",
1212
"binaryDir": "${sourceDir}/build/default"
13-
1413
}
1514
]
1615
}

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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

6364
dependencies:
@@ -72,17 +73,18 @@ lint/yaml:
7273

7374
lint: 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

8789
test/styling:
8890
clang-format --dry-run --Werror $(FILES)

src/lib/exercises/include/exercises/hackerrank/warmup/mini_max_sum.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
namespace hackerrank::warmup {
77
std::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

0 commit comments

Comments
 (0)