Skip to content

Commit 306d59d

Browse files
authored
Merge pull request #1152 from redboltz/update_codecov
Updated codecov.
2 parents 4458801 + 0299d94 commit 306d59d

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

.github/workflows/coverage.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ jobs:
4242
CMAKE_LIBRARY_PATH="${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib64/cmake" cmake -DMSGPACK_32BIT=OFF -DBUILD_SHARED_LIBS=ON -DMSGPACK_CHAR_SIGN=signed -DMSGPACK_BUILD_EXAMPLES=ON -DMSGPACK_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DMSGPACK_GEN_COVERAGE=ON ..
4343
make -j4
4444
make test
45-
- name: Upload coverage to Codecov
46-
working-directory: build
45+
- name: Generate coverage
4746
run: |
4847
# Create lcov report
4948
lcov --capture --directory . --output-file coverage.info
5049
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
5150
lcov --list coverage.info # debug info
52-
# Uploading report to CodeCov
53-
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@v5
53+
with:
54+
files: build/coverage.info
55+
token: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
===================
33

44
Version 6.1.0 [![Build Status](https://github.com/msgpack/msgpack-c/workflows/CI/badge.svg?branch=c_master)](https://github.com/msgpack/msgpack-c/actions) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/c_master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/c_master)
5-
[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/c_master/graph/badge.svg)](https://codecov.io/gh/msgpack/msgpack-c/branch/c_master)
5+
[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/c_master/graph/badge.svg)](https://app.codecov.io/gh/msgpack/msgpack-c/tree/c_master)
66

77
It's like JSON but smaller and faster.
88

codecov.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ comment:
2727

2828
ignore:
2929
- "test"
30-
- "fuzz"
31-
- "erb"
3230
- "ci"
3331
- "cmake"
34-
- "examle"
35-
- "external"
36-
- "usr"
32+
- "example"

test/msgpack_c.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,17 +1688,17 @@ TEST(MSGPACKC, init_msgpack_obj_ext) {
16881688
EXPECT_STREQ(buffer, obj.via.ext.ptr);
16891689
}
16901690

1691+
#define BUFFER_SIZE 4
16911692
TEST(MSGPACKC, init_msgpack_obj_array) {
16921693
msgpack_object obj;
16931694
char buffer[][7] = {"test_1", "test_2", "test_3", "test_4"};
1694-
uint32_t buffer_size = 4;
1695-
msgpack_object array[buffer_size];
1696-
for(size_t i = 0; i < buffer_size; i++) {
1695+
msgpack_object array[BUFFER_SIZE];
1696+
for(size_t i = 0; i < BUFFER_SIZE; i++) {
16971697
msgpack_object_init_str(&array[i], buffer[i], (uint32_t)strlen(buffer[i]));
16981698
}
1699-
msgpack_object_init_array(&obj, array, buffer_size);
1699+
msgpack_object_init_array(&obj, array, BUFFER_SIZE);
17001700
EXPECT_EQ(MSGPACK_OBJECT_ARRAY, obj.type);
1701-
for(size_t i = 0; i < buffer_size; i++) {
1701+
for(size_t i = 0; i < BUFFER_SIZE; i++) {
17021702
EXPECT_STREQ(buffer[i], obj.via.array.ptr[i].via.str.ptr);
17031703
}
17041704
}

0 commit comments

Comments
 (0)