-
Notifications
You must be signed in to change notification settings - Fork 461
Trying out GHA for coverage and debug builds #11198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Myoldmopar
wants to merge
18
commits into
develop
Choose a base branch
from
AddRWDBuildToGHA
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+136
−60
Open
Changes from all 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 83e4c30
Remove Decent CI config files
Myoldmopar b0c29ae
Adding more config vars to the configure-and-build action, adding upt…
Myoldmopar fb078aa
I guess env cannot be in the runs-on tag
Myoldmopar ce85e18
Temporarily disable the other PR workflows
Myoldmopar a2905c8
Install coverage tools, generate html, turn on non-minimal build
Myoldmopar 293d6b9
So close; adjusting path for lcov and moving upterm for debugging
Myoldmopar fc82953
Turn off upterm, try cleaning up coverage results
Myoldmopar 807c72a
Try adding a bit more error handling for lcov and genhtml
Myoldmopar fd22dc3
Update test_pull_request_debug.yml
Myoldmopar 31493f3
Trimmed down test test with upterm enabled
Myoldmopar f76c72f
Dumb attempt, I know jmarrec has a better option
Myoldmopar 567fe53
Merge remote-tracking branch 'origin/develop' into AddRWDBuildToGHA
Myoldmopar ec27e3e
Turn on most test cases, but disable the top 15 or so longest running…
Myoldmopar 4dde722
Merge remote-tracking branch 'origin/develop' into AddRWDBuildToGHA
Myoldmopar a81799d
Re-enable the PR test script, and also clean up the text in the debug…
Myoldmopar c7c4bce
Merge remote-tracking branch 'origin/develop' into AddRWDBuildToGHA
Myoldmopar 9e29d11
Move debug/coverage runs to just develop commits to save CI time
Myoldmopar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: Debug Build and Test | ||
|
|
||
| # run this on all commits to the develop branch | ||
| # once a large runner, or a self-hosted runner, is available, re-enable for all pull requests | ||
| on: | ||
| # pull_request: | ||
| # branches: [ develop ] | ||
| push: | ||
| branches: [ develop, AddRWDBuildToGHA ] | ||
|
|
||
| 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 | ||
|
|
||
| - 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 }} -E "integration\.HospitalLowEnergy|integration\.DirectIndirectEvapCoolersVSAS|integration\.HospitalBaselineReheatReportEMS|integration\.HospitalBaseline|integration\.ASHRAE901_ApartmentHighRise_STD2019_Denver|integration\.RefBldgOutPatientNew2004_Chicago|integration\.UnitarySystem_MultiSpeedDX_EconoStaging|integration\.ASHRAE901_OutPatientHealthCare_STD2019_Denver|integration\.UnitaryHybridAC_DedicatedOutsideAir|integration\.RefrigeratedWarehouse|integration\.RefBldgSecondarySchoolNew2004_Chicago|integration\.LgOffVAVusingBasement|integration\.EcoroofOrlando|integration\._5ZoneAirCooled_LeapYear_annual|integration\.EcoroofOrlando_NoSitePrec|integration\._5ZoneAirCooled_annual"; 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; | ||
|
|
||
| # I fully acknowledge that there is a better way to get coverage results | ||
| # I tried running some of the tips from Julien, but could not get them to work fully | ||
| # The series of steps here are hacky, but pretty much works, so I'm leaving it. | ||
| # When the next person gets here to clean this up, don't forget to add a message to the GITHUB_STEP_SUMMARY | ||
| # And even better would be to post a message as a PR comment like we do for regressions. | ||
|
|
||
| - name: Prepare Initial Coverage Results | ||
| shell: bash | ||
| working-directory: ./build | ||
| run: lcov -c -d . -o lcov.raw.info --base-directory ../src/EnergyPlus --ignore-errors source,mismatch | ||
|
|
||
| - name: Why does it have src/src/? I don't know, but remove it! | ||
| shell: bash | ||
| working-directory: ./build | ||
| run: sed -i 's#/src/src/#/src/#g' lcov.raw.info | ||
|
|
||
| - name: Clean up Coverage Results | ||
| shell: bash | ||
| working-directory: ./build | ||
| run: lcov -e lcov.raw.info "*/EnergyPlus/src/EnergyPlus/*" -o lcov.filtered.info | ||
| # could also run lcov -r to remove some of the generated files, like the embedded schema cc file | ||
|
|
||
| - name: Generate HTML Coverage Package | ||
| shell: bash | ||
| working-directory: ./build | ||
| run: genhtml lcov.filtered.info -o lcov-html --title "EnergyPlus Coverage" --synthesize-missing --ignore-errors source | ||
|
|
||
| - name: Upload folder as artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-results | ||
| path: ./build/lcov-html | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK,
pip install gcovrpulls in 8.3, while apt on ubuntu 24.04 pulls in 7.0