-
Notifications
You must be signed in to change notification settings - Fork 49
115 lines (96 loc) · 3.1 KB
/
testing_projects.yaml
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
109
110
111
112
113
114
115
name: Projects
on:
push:
branches:
- master
pull_request:
branches:
- master
# Cancel previous CI runs when new commits are added to a PR.
concurrency:
group: ${{ github.head_ref || github.run_id }}-projects
cancel-in-progress: true
jobs:
build_linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Build Tools
run: |
pip install -U pip
pip install codecov gcovr
# cpp_long_names test runs code from testing/tests/cpp_long_names.py,
# so we need to install the runtime dependencies of Exhale's Python tests.
pip install . pytest pytest-raises>=0.10
sudo apt-get install -y \
cmake \
gcc \
g++ \
gfortran \
make
- name: Build Tool Versions
run: |
gcc --version
g++ --version
gfortran --version
cmake --version
- name: Build and Upload Coverage
run: |
cd testing/projects
mkdir build
cd build
cmake ..
make -j
make coverage-xml
codecov -X gcov -f .\coverage.xml --name linux_cxx
build_windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Use Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Build Tools
run: |
pip install -U pip
pip install codecov gcovr
# cpp_long_names test runs code from testing/tests/cpp_long_names.py,
# so we need to install the runtime dependencies of Exhale's Python tests.
pip install . pytest pytest-raises>=0.10
choco install opencppcoverage
echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Setup Windows Dev Env
uses: ilammy/[email protected]
with:
arch: x64
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Build Tool Versions
run: |
cl
ninja --version
cmake --version
- name: Build and Upload Coverage
run: |
cd testing\projects
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja coverage-xml
# Gerrymander generated coverage report to include paths from the
# repository root (rather than let GitHub Actions build folder paths
# leak in -- D:\a\exhale\exhale).
(Get-Content .\coverage.xml) -replace '(.*)filename=\"a\\exhale\\exhale\\(.*)\"(.*)', '$1 filename="$2"$3' | Set-Content .\coverage.xml
Copy-Item .\coverage.xml -Destination D:\a\exhale\exhale
cd D:\a\exhale\exhale
type coverage.xml
$codecov_cmd = '& codecov -X gcov -f .\coverage.xml --name windows_cxx'
Invoke-Expression $codecov_cmd