Skip to content

Commit

Permalink
Merge pull request #56 from acooks/gh-ci-actions-churn
Browse files Browse the repository at this point in the history
Add/Fix code climate code coverage
  • Loading branch information
acooks authored Oct 31, 2023
2 parents b988830 + d685004 commit 3cc12c7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
sudo apt-get update
sudo apt-get install libnl-3-dev libnl-route-3-dev libnl-genl-3-dev libjansson-dev libwebsockets-dev libncurses5-dev libpcap-dev pkgconf lcov
- name: make
run: CFLAGS="-fprofile-arcs -ftest-coverage" make
run: make

- name: Run tests
run: sudo CFLAGS="-fprofile-arcs -ftest-coverage" make test
run: sudo make test

- name: Upload coverage to Code Climate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }}
with:
coverageCommand: lcov -c -d server -d cli-client -d messages/ -o jittertrap.lcov
coverageCommand: make coverage
coverageLocations: ${{github.workspace}}/*.lcov:lcov
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ cppcheck:
clang-analyze:
scan-build make messages server cli-client

coverage:
CFLAGS="-fprofile-arcs -ftest-coverage" $(MAKE) clean test
lcov -c --no-external -d server -d cli-client -d messages -o jittertrap.lcov


.PHONY: clean $(CLEANDIRS)
clean: $(CLEANDIRS)
$(CLEANDIRS):
Expand Down
2 changes: 2 additions & 0 deletions cli-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ indent:
.PHONY: clean
clean:
rm $(PROG) || true
rm *.gcno *.gcov *.gcda || true


.PHONY: test
test:
Expand Down
1 change: 1 addition & 0 deletions deps/toptalk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ clang-analyze: clean
.PHONY: clean
clean:
rm $(LIB) $(PROG) $(TEST) *.o *.a || true
rm *.gcno *.gcov *.gcda || true
1 change: 1 addition & 0 deletions messages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ test: test-packing
.PHONY: clean
clean:
rm $(LIB) *.o *.a test-packing || true
rm *.gcno *.gcov *.gcda || true
1 change: 1 addition & 0 deletions server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,4 @@ test-toptalk: $(TOPTALK_LIB) $(TOPTALK_TEST_SOURCES)
clean:
rm $(PROG) *.o || true
rm test-mq test-mq-mt test-multi-mq || true
rm *.gcno *.gcov *.gcda || true

0 comments on commit 3cc12c7

Please sign in to comment.