Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b98c0c0
Add RelWithDebugInfo build type to action and enable it
Myoldmopar Sep 6, 2025
83e4c30
Remove Decent CI config files
Myoldmopar Sep 6, 2025
b0c29ae
Adding more config vars to the configure-and-build action, adding upt…
Myoldmopar Sep 6, 2025
fb078aa
I guess env cannot be in the runs-on tag
Myoldmopar Sep 6, 2025
ce85e18
Temporarily disable the other PR workflows
Myoldmopar Sep 6, 2025
a2905c8
Install coverage tools, generate html, turn on non-minimal build
Myoldmopar Sep 6, 2025
293d6b9
So close; adjusting path for lcov and moving upterm for debugging
Myoldmopar Sep 6, 2025
fc82953
Turn off upterm, try cleaning up coverage results
Myoldmopar Sep 7, 2025
807c72a
Try adding a bit more error handling for lcov and genhtml
Myoldmopar Sep 7, 2025
fd22dc3
Update test_pull_request_debug.yml
Myoldmopar Sep 7, 2025
31493f3
Trimmed down test test with upterm enabled
Myoldmopar Sep 9, 2025
f76c72f
Dumb attempt, I know jmarrec has a better option
Myoldmopar Sep 12, 2025
567fe53
Merge remote-tracking branch 'origin/develop' into AddRWDBuildToGHA
Myoldmopar Sep 12, 2025
ec27e3e
Turn on most test cases, but disable the top 15 or so longest running…
Myoldmopar Sep 12, 2025
4dde722
Merge remote-tracking branch 'origin/develop' into AddRWDBuildToGHA
Myoldmopar Sep 15, 2025
a81799d
Re-enable the PR test script, and also clean up the text in the debug…
Myoldmopar Sep 15, 2025
c7c4bce
Merge remote-tracking branch 'origin/develop' into AddRWDBuildToGHA
Myoldmopar Sep 15, 2025
9e29d11
Move debug/coverage runs to just develop commits to save CI time
Myoldmopar Sep 15, 2025
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
38 changes: 0 additions & 38 deletions .decent_ci-Linux.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .decent_ci-Windows.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions .decent_ci.yaml

This file was deleted.

19 changes: 15 additions & 4 deletions .github/actions/configure-and-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ inputs:
enable-pch:
description: "Turn on ENABLE_PCH to have pre-compiled headers. Pass ON or OFF"
default: "OFF"
build-type:
description: "The CMake build type to use, which will default to release"
default: "Release"
enable-coverage:
description: "Turn this on to set the ENABLE_COVERAGE CMake variable to ON. Pass ON or OFF."
default: "OFF"
build-python-cli:
description: "Turn on the PYTHON_CLI build configuration. Pass ON or OFF."
default: "ON"

runs:
using: "composite"
Expand Down Expand Up @@ -50,9 +59,10 @@ runs:
cmake `
-G Ninja `
-DENABLE_PCH:BOOL=${{ inputs.enable-pch }} `
-DCMAKE_BUILD_TYPE:STRING=Release `
-DCMAKE_BUILD_TYPE:STRING=${{ inputs.build-type }} `
-DLINK_WITH_PYTHON:BOOL=ON `
-DPYTHON_CLI:BOOL=ON `
-DPYTHON_CLI:BOOL=${{ inputs.build-python-cli }} `
-DENABLE_COVERAGE:BOOL=${{ inputs.enable-coverage }} `
-DPython_REQUIRED_VERSION:STRING=${{ inputs.python-version }} `
-DPython_ROOT_DIR:PATH=${{ inputs.python-root-dir }} `
-DBUILD_TESTING:BOOL=ON `
Expand Down Expand Up @@ -91,9 +101,10 @@ runs:
cmake \
-G Ninja \
-DENABLE_PCH:BOOL=${{ inputs.enable-pch }} \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_BUILD_TYPE:STRING=${{ inputs.build-type }} \
-DLINK_WITH_PYTHON:BOOL=ON \
-DPYTHON_CLI:BOOL=ON \
-DPYTHON_CLI:BOOL=${{ inputs.build-python-cli }} \
-DENABLE_COVERAGE:BOOL=${{ inputs.enable-coverage }} \
-DPython_REQUIRED_VERSION:STRING=${{ inputs.python-version }} \
-DPython_ROOT_DIR:PATH=${{ inputs.python-root-dir }} \
-DBUILD_TESTING:BOOL=ON \
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/test_pull_request_debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Debug Build and Test

on:
pull_request:
branches: [ develop ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FC: gfortran-13
Python_REQUIRED_VERSION: 3.12.3 # 3.12.2 not available on Ubuntu 24 GHA
python-arch: x64
os: ubuntu-24.04

jobs:
build_and_test:
name: Debug Testing
runs-on: ubuntu-24.04
permissions:
pull-requests: write

steps:

- uses: actions/checkout@v5

- name: Setup System
id: setup-runner
uses: ./.github/actions/setup-runner
with:
python-version: ${{ env.Python_REQUIRED_VERSION }}
python-arch: ${{ env.python-arch }}

- name: Install coverage tools
shell: bash
run: sudo apt-get update && sudo apt-get install lcov gcovr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, pip install gcovr pulls in 8.3, while apt on ubuntu 24.04 pulls in 7.0


- name: Create Build Directory
shell: bash
run: cmake -E make_directory ./build/

- name: Install problem matcher
shell: bash
run: echo "::add-matcher::./.github/workflows/cpp-problem-matcher.json"

- name: Configure and Build
id: branch_build
uses: ./.github/actions/configure-and-build
with:
enable-pch: ${{ env.ENABLE_PCH }}
minimal-targets: false
build-directory: ./build
nproc: ${{ steps.setup-runner.outputs.nproc }}
python-version: ${{ env.Python_REQUIRED_VERSION }}
python-root-dir: ${{ steps.setup-runner.outputs.python-root-dir }}
build-type: "RelWithDebInfo"
enable-coverage: "ON"
build-python-cli: "OFF"

- name: Remove problem matcher
shell: bash
run: echo "::remove-matcher owner=gcc-problem-matcher::"

- name: Run Tests
working-directory: ./build
shell: bash
run: |
begin_group() { echo -e "::group::\033[93m$1\033[0m"; }

Color_Off='\033[0m' # Text Reset

# Regular Colors
Red='\033[0;31m'
Green='\033[0;32m'

begin_group "Running CTests"
if ctest -j ${{ env.NPROC }}; then
echo "::endgroup::"
echo -e "✅ ${Green}All tests passed${Color_Off}"
else
echo "::endgroup::"
echo -e "❌ ${Red}Some Tests Failed${Color_Off}"
begin_group "Re-running failed tests verbosely..."
ctest --rerun-failed -VV
echo "::endgroup::"
fi;

# - name: Setup upterm session
# uses: owenthereal/action-upterm@v1

- name: Prepare Initial Coverage Results
shell: bash
working-directory: ./build
run: lcov -c -d . -o ./lcov.output --no-external --base-directory ../src/EnergyPlus --ignore-errors source

- name: Clean up Coverage Results
shell: bash
working-directory: ./build
run: lcov -r ./lcov.output `pwd`/\* -o ./lcov.output.filtered --ignore-errors source

- name: Generate HTML Coverage Package
shell: bash
working-directory: ./build
run: genhtml ./lcov.output.filtered -o lcov-html --demangle-cpp --function-coverage --synthesize-missing
Copy link
Contributor

@jmarrec jmarrec Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by the use the lcov and genhtml here. What's the point of installing gcovr then?

I have an older coverage test repo:
https://github.com/jmarrec/TestCpp-GHA-Coverage/blob/a7681924a92306a05a9d8486f8f1bdcd079b6239/.github/workflows/build.yml#L86-L99

gcovr -j $(nproc) --delete --root ../ --exclude '.*GTest.cpp' --print-summary --xml-pretty --xml coverage.xml .

So I guess you'd do something like this?

gcovr -j $(nproc) --delete --root ../  --exclude '.*unit.cc' --print-summary --html --html-details -o coverage.html

Maybe could do somthing like this too to make a table on the workflow summary page?

- name: Coverage summary
  shell: bash
  working-directory: ./build
  run: |
    gcovr --root ../ --txt-summary -o coverage_summary.txt
    echo "## Code Coverage" >> $GITHUB_STEP_SUMMARY
    echo '```' >> $GITHUB_STEP_SUMMARY
    cat coverage_summary.txt >> $GITHUB_STEP_SUMMARY
    echo '```' >> $GITHUB_STEP_SUMMARY

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcovr gained a markdown option, unreleased yet.

pip install git+https://github.com/gcovr/gcovr.git

gcovr --root ../ --markdown-summary >> $GITHUB_STEP_SUMMARY


GCC Code Coverage Report

📂 Overall coverage

Metric Coverage
Lines 🟢 35/35 (100.0%)
Functions 🟢 13/13 (100.0%)
Branches 🔴 31/120 (25.8%)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@jmarrec jmarrec Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually I think you'd be doing something like

    mkdir html
    gcovr -j $(nproc) \
      --gcov-ignore-errors=source_not_found \
      --gcov-ignore-errors=no_working_dir_found \
      --gcov-ignore-parse-errors=suspicious_hits.warn_once_per_file \
      --merge-mode-functions=merge-use-line-min \
      --print-summary \
      --html=html/index.html --html-details \
      --markdown=summary.md \
      --root ../src/EnergyPlus \
      --exclude '.*unit.cc' \
      --exclude '.*test/.*' \
      --exclude '/usr/.*' \
      --gcov-object-directory=.
    cat summary.md >> $GITHUB_STEP_SUMMARY


- name: Upload folder as artifact
uses: actions/upload-artifact@v4
with:
name: coverage-results
path: ./build/lcov-html
Loading