mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Exclude Bison-generated files from coverage report, and use dark theme (#1742)
This commit is contained in:
8
.github/workflows/coverage.yml
vendored
8
.github/workflows/coverage.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
coverage:
|
coverage:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -27,4 +27,8 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: coverage-report
|
name: coverage-report
|
||||||
path: coverage
|
# Workaround for keeping the top-level coverage/ directory
|
||||||
|
# https://github.com/actions/upload-artifact/issues/174
|
||||||
|
path: |
|
||||||
|
coverage
|
||||||
|
dummy-file-to-keep-directory-structure.txt
|
||||||
|
|||||||
@@ -14,20 +14,18 @@ popd
|
|||||||
gcov src/**/*.cpp
|
gcov src/**/*.cpp
|
||||||
mkdir -p coverage
|
mkdir -p coverage
|
||||||
|
|
||||||
|
# Generate coverage report, excluding Bison-generated files
|
||||||
|
COVERAGE_INFO=coverage/coverage.info
|
||||||
|
lcov -c --no-external -d . -o "$COVERAGE_INFO"
|
||||||
|
lcov -r "$COVERAGE_INFO" src/asm/parser.{hpp,cpp} src/link/script.{hpp,cpp} -o "$COVERAGE_INFO"
|
||||||
|
genhtml --dark-mode -f -s -o coverage/ "$COVERAGE_INFO"
|
||||||
|
|
||||||
# Check whether running from coverage.yml workflow
|
# Check whether running from coverage.yml workflow
|
||||||
if [ "$1" != "false" ]; then
|
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
|
# Open report in web browser
|
||||||
if [ "$(uname)" == "Darwin" ]; then
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
open coverage/index.html
|
open coverage/index.html
|
||||||
else
|
else
|
||||||
xdg-open coverage/index.html
|
xdg-open coverage/index.html
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
# Generate coverage report
|
|
||||||
lcov -c --no-external -d . -o coverage/coverage.info
|
|
||||||
genhtml -f -s -o coverage/ coverage/coverage.info
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user