-
Notifications
You must be signed in to change notification settings - Fork 472
108 lines (88 loc) · 3.05 KB
/
test_pull_request_debug.yml
File metadata and controls
108 lines (88 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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
- 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
- name: Upload folder as artifact
uses: actions/upload-artifact@v4
with:
name: coverage-results
path: ./build/lcov-html