Skip to content

Commit

Permalink
Split unit test coverage and integration debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Aug 28, 2024
1 parent c064c30 commit ba45f76
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/debug_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,39 +86,3 @@ jobs:
with:
name: "unit_test_coverage_results"
path: "${{ github.workspace }}/build/lcov-html"

- name: Clean Test Coverage
working-directory: ./build
run: |
find . -name "*.gcda" -type f -delete
rm lcov.output
rm lcov.output.filtered
rm -rf lcov-html
- name: Run Integration Tests
working-directory: ./build
run: ctest -R "integration.*"

- name: Generate Raw Integration Test Coverage Results
working-directory: ./build
run: lcov -c -d . -o ./lcov.output --no-external --base-directory ../src/EnergyPlus/

- name: Generate Filtered Integration Test Coverage Results
working-directory: ./build
run: lcov -r ./lcov.output -o lcov.output.filtered

- name: Generate HTML Integration Test Coverage Results
working-directory: ./build
run: genhtml ./lcov.output.filtered -o lcov-html --demangle-cpp --function-coverage | tee cover.txt

- name: Process Integration Test Coverage Summary
working-directory: ./build
run: python ${{ github.workspace }}/scripts/dev/gha_coverage_summary.py

- name: Generate Integration Test Artifact Summary
run: echo "$(cat ${{ github.workspace }}/build/cover.md)" >> $GITHUB_STEP_SUMMARY

- uses: actions/upload-artifact@v4
with:
name: "integration_test_coverage_results"
path: "${{ github.workspace }}/build/lcov-html"
63 changes: 63 additions & 0 deletions .github/workflows/debug_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Debug Build with Coverage

on:
pull_request:
branches: [ develop ] # run this on any PR pointing to develop
push:
branches: [ develop ] # also run this on any commit to 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
shell: bash

jobs:
run_debug_coverage:
runs-on: ubuntu-24.04
permissions:
pull-requests: write
steps:

- name: Set up Python ${{ env.Python_REQUIRED_VERSION }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ env.Python_REQUIRED_VERSION }}

- name: Install Dependencies for Linux
run: |
sudo apt-get update
sudo apt-get install libxkbcommon-x11-0 xorg-dev libgl1-mesa-dev lcov gcovr
# https://github.com/actions/runner-images/issues/10025
echo "FC=gfortran-13" >> $GITHUB_ENV
- uses: actions/checkout@v4

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

- name: Configure CMake
working-directory: ./build
run: >
cmake
-G "Unix Makefiles"
-DCMAKE_BUILD_TYPE:STRING=Debug
-DLINK_WITH_PYTHON:BOOL=ON
-DPython_REQUIRED_VERSION:STRING=${{ steps.setup-python.outputs.python-version }}
-DPython_ROOT_DIR:PATH=$RUNNER_TOOL_CACHE/Python/${{ steps.setup-python.outputs.python-version }}/x64/
-DBUILD_TESTING:BOOL=ON
-DBUILD_FORTRAN:BOOL=ON
-DBUILD_PACKAGE:BOOL=OFF
-DDOCUMENTATION_BUILD:STRING=DoNotBuild
-DENABLE_OPENMP:BOOL=OFF
-DUSE_OpenMP:BOOL=OFF
../
- name: Build
working-directory: ./build
run: cmake --build . -j 4

- name: Run Integration Tests
working-directory: ./build
run: ctest -R "integration.*"

0 comments on commit ba45f76

Please sign in to comment.