Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checkdiff.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code coverage checking
name: Diff completeness check
on: pull_request

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checkformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
uses: actions/checkout@v4
- name: Check format
run: |
./contrib/checkformat.bash
contrib/checkformat.bash
30 changes: 30 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Code coverage report
on:
- push
- pull_request

jobs:
coverage:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install deps
shell: bash
run: |
./.github/scripts/install_deps.sh ubuntu
- name: Install LCOV
run: |
sudo apt-get install lcov
- name: Install test dependency dependencies
shell: bash
run: |
test/fetch-test-deps.sh --get-deps ubuntu
- name: Generate coverage report
run: |
contrib/coverage.bash false
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage
22 changes: 14 additions & 8 deletions contrib/coverage.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
set -e

# Build RGBDS with gcov support

make coverage -j

# Run the tests
Expand All @@ -15,13 +14,20 @@ popd
gcov src/**/*.cpp
mkdir -p coverage

# Generate coverage report
lcov -c --no-external -d . -o coverage/coverage.info --ignore-errors format,inconsistent,unsupported
genhtml -f -s -o coverage/ coverage/coverage.info --ignore-errors category,corrupt,inconsistent
# Check whether running from coverage.yml workflow
if [ "$1" != "false" ]; then
# Generate coverage report
lcov -c --no-external -d . -o coverage/coverage.info --ignore-errors format,inconsistent,unsupported
genhtml -f -s -o coverage/ coverage/coverage.info --ignore-errors category,corrupt,inconsistent

# Open report in web browser
if [ "$(uname)" == "Darwin" ]; then
open coverage/index.html
# Open report in web browser
if [ "$(uname)" == "Darwin" ]; then
open coverage/index.html
else
xdg-open coverage/index.html
fi
else
xdg-open coverage/index.html
# Generate coverage report
lcov -c --no-external -d . -o coverage/coverage.info
genhtml -f -s -o coverage/ coverage/coverage.info
fi
Loading