-
Notifications
You must be signed in to change notification settings - Fork 4
185 lines (183 loc) · 6.24 KB
/
build-test.yaml
File metadata and controls
185 lines (183 loc) · 6.24 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
##
## Copyright (c) 2025-2026 The Johns Hopkins University Applied Physics
## Laboratory LLC.
##
## This file is part of the Bundle Protocol Security Library (BSL).
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
## http://www.apache.org/licenses/LICENSE-2.0
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
## This work was performed for the Jet Propulsion Laboratory, California
## Institute of Technology, sponsored by the United States Government under
## the prime contract 80NM0018D0004 between the Caltech and NASA under
## subcontract 1700763.
##
name: Build and run tests
on:
schedule:
- cron: '0 0 * * 0'
push:
branches:
- main
- 'apl-fy[0-9][0-9]'
pull_request: {} # any target
jobs:
unit-test:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.04', 'centos-9']
compiler: ['gcc', 'clang']
name: Unit Test (${{matrix.os}} ${{matrix.compiler}})
runs-on: ${{ matrix.os == 'centos-9' && 'ubuntu-24.04' || matrix.os }}
container: ${{ matrix.os == 'centos-9' && 'quay.io/centos/centos:stream9' || null }}
permissions:
contents: read
actions: write
env:
CC: ${{matrix.compiler=='clang' && 'clang' || 'gcc'}}
CXX: ${{matrix.compiler=='clang' && 'clang++' || 'g++'}}
steps:
- name: Set up OS
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y \
cmake ninja-build \
ruby pkg-config ccache patch \
${{matrix.compiler=='clang' && 'clang llvm' || 'gcc g++'}} \
libssl-dev libjansson-dev \
valgrind xmlstarlet \
python3 python3-pip python3-wheel
pip3 install gcovr
- name: Set up OS
if: startsWith(matrix.os, 'centos')
run: |
dnf install -y epel-release
crb enable
dnf install -y \
git rsync \
cmake ninja-build \
ruby pkg-config ccache patch \
${{matrix.compiler=='clang' && 'clang llvm' || 'gcc gcc-c++'}} \
openssl-devel jansson-devel \
valgrind valgrind-devel xmlstarlet \
python3 python3-pip python3-wheel
pip3 install gcovr
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.22
with:
create-symlink: true
- name: Dependencies
run: ./build.sh deps
- name: Prep
run: >
./build.sh prep
-DBUILD_DOCS_API=OFF -DBUILD_DOCS_MAN=OFF
-DBUILD_UNITTEST=ON -DBUILD_COVERAGE=ON
- name: Build
run: ./build.sh
- name: Install
run: ./build.sh install
- name: Check symbols
run: |
./check_symbols.py bsl_front bsl_dynamic --prefix bsl_
./check_symbols.py bsl_crypto --prefix bsl_ bslb_
./check_symbols.py bsl_default_sc --prefix bslx_
./check_symbols.py bsl_sample_pp --prefix bslp_
./check_symbols.py bsl_mock_bpa --prefix MockBPA_ bsl_eidpat_ bsl_mock_ mock_bpa_
- name: Test
run: ./build.sh check
- name: Collect coverage
run: |
./build.sh coverage
./build.sh coverage-summary >> $GITHUB_STEP_SUMMARY
- name: Archive coverage
uses: actions/upload-artifact@v6
with:
name: ${{github.job}}-${{matrix.os}}-${{matrix.compiler}}-coverage
path: build/default/coverage*
mock-bpa-test:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.04', 'centos-9']
name: Mock BPA Test (${{matrix.os}} gcc)
runs-on: ${{ matrix.os == 'centos-9' && 'ubuntu-24.04' || matrix.os }}
container: ${{ matrix.os == 'centos-9' && 'quay.io/centos/centos:stream9' || null }}
permissions:
contents: read
actions: write
steps:
- name: Set up OS
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y \
cmake ninja-build ruby gcc g++ ccache patch \
libssl-dev libjansson-dev \
valgrind xmlstarlet \
python3 python3-pip python3-wheel
pip3 install gcovr
- name: Set up OS
if: startsWith(matrix.os, 'centos')
run: |
dnf config-manager --set-enabled crb
dnf install -y epel-release
dnf install -y \
git rsync \
cmake ninja-build \
ruby pkg-config gcc gcc-c++ ccache patch \
openssl-devel jansson-devel \
valgrind valgrind-devel xmlstarlet \
python3 python3-pip python3-wheel
pip3 install gcovr
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.22
with:
create-symlink: true
- name: Dependencies
run: ./build.sh deps
- name: Prep
run: >
./build.sh prep
-DBUILD_DOCS_API=OFF -DBUILD_DOCS_MAN=OFF
-DBUILD_UNITTEST=OFF -DBUILD_COVERAGE=ON
- name: Build
run: ./build.sh
- name: Install
run: ./build.sh install
- name: Test Prep
run: |
pip3 install --upgrade pip
pip3 install -r mock-bpa-test/requirements.txt
- name: Test
env:
TEST_MEMCHECK: '1'
run: python3 -m pytest mock-bpa-test
- name: Collect coverage
run: |
./build.sh coverage
./build.sh coverage-summary >> $GITHUB_STEP_SUMMARY
- name: Archive coverage
uses: actions/upload-artifact@v6
with:
name: ${{github.job}}-${{matrix.os}}-gcc-coverage
path: build/default/coverage*