1010 required : false
1111 default : " "
1212
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.inputs.ref || github.ref }}
15+ cancel-in-progress : true
16+
1317env :
1418 PYTHON_REQUIRED_VERSION : " 3.12.2"
1519 FC : gfortran-13
6064 - name : Install Linux coverage tools
6165 run : |
6266 sudo apt-get -qq update
63- sudo apt-get -qq install -y lcov gcovr
67+ sudo apt-get -qq install -y lcov
6468
6569 - name : Show restored ccache stats
6670 shell : bash
8892 -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF
8993 -DENABLE_PCH:BOOL=OFF
9094 -DFORCE_DEBUG_ARITHM_GCC_OR_CLANG:BOOL=ON
91- -DCOMMIT_SHA:STRING="$(git rev-parse HEAD)"
95+ -DCOMMIT_SHA:STRING=${{ steps.checkout-sha.outputs.sha }}
9296
9397 - name : Build coverage targets
9498 run : cmake --build ${{ env.BUILD_DIR }} -j "${{ steps.setup-runner.outputs.nproc }}"
@@ -105,24 +109,15 @@ jobs:
105109 --output-on-failure
106110 -j "${{ steps.setup-runner.outputs.nproc }}"
107111
108- - name : Create coverage output directories
109- working-directory : ${{ env.BUILD_DIR }}
110- run : mkdir -p coverage/unit coverage/integration
111-
112- - name : Generate raw unit test coverage results
113- working-directory : ${{ env.BUILD_DIR }}
114- run : lcov -c -d . -o coverage/unit/lcov.output --no-external --base-directory ${{ github.workspace }} --ignore-errors source,source
115-
116- - name : Generate filtered unit test coverage results
112+ - name : Generate unit test coverage results
117113 working-directory : ${{ env.BUILD_DIR }}
118114 run : |
119- if ! lcov -e coverage/unit/lcov.output "${{ github.workspace }}/src/EnergyPlus/*" -o coverage/unit/lcov.output.filtered --ignore-errors unused,unused,empty,empty; then
120- cp -f coverage/unit/lcov.output coverage/unit/lcov.output.filtered
121- fi
122-
123- - name : Generate HTML unit test coverage results
124- working-directory : ${{ env.BUILD_DIR }}
125- run : genhtml coverage/unit/lcov.output.filtered -o coverage/unit/lcov-html --demangle-cpp --function-coverage --synthesize-missing --ignore-errors source,source | tee coverage/unit/cover.txt
115+ mkdir -p coverage/unit
116+ lcov -c -d . -o coverage/unit/lcov.output --no-external --base-directory ${{ github.workspace }} --ignore-errors source,source
117+ lcov -e coverage/unit/lcov.output "${{ github.workspace }}/src/EnergyPlus/*" -o coverage/unit/lcov.output.filtered --ignore-errors unused,unused,empty,empty
118+ # Coveralls needs repo-relative SF paths to fetch source for line views.
119+ sed "s#^SF:${{ github.workspace }}/#SF:#" coverage/unit/lcov.output.filtered > coverage/unit/lcov.output.coveralls
120+ genhtml coverage/unit/lcov.output.filtered -o coverage/unit/lcov-html --demangle-cpp --function-coverage --synthesize-missing --ignore-errors source,source | tee coverage/unit/cover.txt
126121
127122 - name : Process unit test coverage summary
128123 working-directory : ${{ env.BUILD_DIR }}/coverage/unit
@@ -145,20 +140,15 @@ jobs:
145140 --output-on-failure
146141 -j "${{ steps.setup-runner.outputs.nproc }}"
147142
148- - name : Generate raw integration test coverage results
149- working-directory : ${{ env.BUILD_DIR }}
150- run : lcov -c -d . -o coverage/integration/lcov.output --no-external --base-directory ${{ github.workspace }} --ignore-errors source,source
151-
152- - name : Generate filtered integration test coverage results
143+ - name : Generate integration test coverage results
153144 working-directory : ${{ env.BUILD_DIR }}
154145 run : |
155- if ! lcov -e coverage/integration/lcov.output "${{ github.workspace }}/src/EnergyPlus/*" -o coverage/integration/lcov.output.filtered --ignore-errors unused,unused,empty,empty; then
156- cp -f coverage/integration/lcov.output coverage/integration/lcov.output.filtered
157- fi
158-
159- - name : Generate HTML integration test coverage results
160- working-directory : ${{ env.BUILD_DIR }}
161- run : genhtml coverage/integration/lcov.output.filtered -o coverage/integration/lcov-html --demangle-cpp --function-coverage --synthesize-missing --ignore-errors source,source | tee coverage/integration/cover.txt
146+ mkdir -p coverage/integration
147+ lcov -c -d . -o coverage/integration/lcov.output --no-external --base-directory ${{ github.workspace }} --ignore-errors source,source
148+ lcov -e coverage/integration/lcov.output "${{ github.workspace }}/src/EnergyPlus/*" -o coverage/integration/lcov.output.filtered --ignore-errors unused,unused,empty,empty
149+ # Coveralls needs repo-relative SF paths to fetch source for line views.
150+ sed "s#^SF:${{ github.workspace }}/#SF:#" coverage/integration/lcov.output.filtered > coverage/integration/lcov.output.coveralls
151+ genhtml coverage/integration/lcov.output.filtered -o coverage/integration/lcov-html --demangle-cpp --function-coverage --synthesize-missing --ignore-errors source,source | tee coverage/integration/cover.txt
162152
163153 - name : Process integration test coverage summary
164154 working-directory : ${{ env.BUILD_DIR }}/coverage/integration
@@ -171,32 +161,34 @@ jobs:
171161
172162 - name : Upload unit test coverage to Coveralls
173163 id : coveralls-unit
174- if : ${{ always() && hashFiles(format('{0}/{1}/coverage/unit/lcov.output.filtered ', github.workspace, env.BUILD_DIR)) != '' }}
164+ if : ${{ always() && hashFiles(format('{0}/{1}/coverage/unit/lcov.output.coveralls ', github.workspace, env.BUILD_DIR)) != '' }}
175165 uses : coverallsapp/github-action@v2
176166 with :
177167 github-token : ${{ secrets.GITHUB_TOKEN }}
178- file : ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/unit/lcov.output.filtered
168+ file : ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/unit/lcov.output.coveralls
179169 format : lcov
170+ base-path : ${{ github.workspace }}
180171 flag-name : unit-tests
181172 parallel : true
182173 build-number : ${{ github.run_id }}
183174 git-branch : ${{ github.head_ref || github.ref_name }}
184- git-commit : ${{ github.event.pull_request.head.sha || steps.checkout-sha.outputs.sha }}
175+ git-commit : ${{ steps.checkout-sha.outputs.sha }}
185176 fail-on-error : false
186177
187178 - name : Upload integration test coverage to Coveralls
188179 id : coveralls-integration
189- if : ${{ always() && hashFiles(format('{0}/{1}/coverage/integration/lcov.output.filtered ', github.workspace, env.BUILD_DIR)) != '' }}
180+ if : ${{ always() && hashFiles(format('{0}/{1}/coverage/integration/lcov.output.coveralls ', github.workspace, env.BUILD_DIR)) != '' }}
190181 uses : coverallsapp/github-action@v2
191182 with :
192183 github-token : ${{ secrets.GITHUB_TOKEN }}
193- file : ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/integration/lcov.output.filtered
184+ file : ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/integration/lcov.output.coveralls
194185 format : lcov
186+ base-path : ${{ github.workspace }}
195187 flag-name : integration-tests
196188 parallel : true
197189 build-number : ${{ github.run_id }}
198190 git-branch : ${{ github.head_ref || github.ref_name }}
199- git-commit : ${{ github.event.pull_request.head.sha || steps.checkout-sha.outputs.sha }}
191+ git-commit : ${{ steps.checkout-sha.outputs.sha }}
200192 fail-on-error : false
201193
202194 - name : Finish Coveralls coverage build
@@ -207,7 +199,7 @@ jobs:
207199 parallel-finished : true
208200 build-number : ${{ github.run_id }}
209201 git-branch : ${{ github.head_ref || github.ref_name }}
210- git-commit : ${{ github.event.pull_request.head.sha || steps.checkout-sha.outputs.sha }}
202+ git-commit : ${{ steps.checkout-sha.outputs.sha }}
211203 fail-on-error : false
212204
213205 - name : Upload unit test coverage artifacts
@@ -217,6 +209,7 @@ jobs:
217209 name : unit_test_coverage_results
218210 path : |
219211 ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/unit/lcov.output.filtered
212+ ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/unit/lcov.output.coveralls
220213 ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/unit/lcov-html
221214
222215 - name : Upload integration test coverage artifacts
@@ -226,6 +219,7 @@ jobs:
226219 name : integration_test_coverage_results
227220 path : |
228221 ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/integration/lcov.output.filtered
222+ ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/integration/lcov.output.coveralls
229223 ${{ github.workspace }}/${{ env.BUILD_DIR }}/coverage/integration/lcov-html
230224
231225 - name : Save ccache
0 commit comments