-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (154 loc) · 5.63 KB
/
build-test.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
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
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-22.04', 'ubuntu-24.04', 'centos-9']
deps: ['full', 'minimal']
name: Unit Test (${{matrix.os}} deps=${{matrix.deps}})
runs-on: ${{ matrix.os == 'centos-9' && 'ubuntu-24.04' || matrix.os }}
container: ${{ matrix.os == 'centos-9' && 'quay.io/centos/centos:stream9' || null }}
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 build-essential patch autoconf libtool \
${{matrix.deps=='full' && 'flex libfl-dev bison libpcre2-dev civetweb libcivetweb-dev libssl-dev libcjson-dev libsystemd-dev' || ''}} \
valgrind gcovr xmlstarlet
- 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 autoconf libtool \
${{matrix.deps=='full' && 'flex libfl-static bison pcre2-devel civetweb civetweb-devel openssl-devel cjson-devel systemd-devel' || ''}} \
valgrind xmlstarlet python3-pip
pip3 install gcovr
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: ccache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
- name: Dependencies
env:
DEPS_BUILD_ION: ${{matrix.deps=='full' && '1' || '0'}}
run: ./deps.sh
- name: Prep
run: |
./prep.sh -DBUILD_DOCS_API=OFF -DBUILD_DOCS_MAN=OFF -DBUILD_TESTING=ON \
-DARI_TEXT_PARSE=${{matrix.deps=='full' && 'ON' || 'OFF'}} \
-DTRANSPORT_ION_BP=${{matrix.deps=='full' && 'ON' || 'OFF'}}
- name: Build
run: ./build.sh
- name: Test
run: ./build.sh check
- name: Collect coverage
run: ./build.sh coverage
- name: Archive coverage
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-${{matrix.os}}-${{matrix.deps}}-coverage
path: build/default/coverage*
- name: Report coverage
run: |
SRC_COV_PERC=$(xmlstarlet sel -t -v 'floor(/coverage/@line-rate * 100)' -n build/default/coverage-cace-xml.xml)
echo "CACE coverage: ${SRC_COV_PERC}%" >> $GITHUB_STEP_SUMMARY
SRC_COV_PERC=$(xmlstarlet sel -t -v 'floor(/coverage/@line-rate * 100)' -n build/default/coverage-refda-xml.xml)
echo "REFDA coverage: ${SRC_COV_PERC}%" >> $GITHUB_STEP_SUMMARY
item-test:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.04', 'centos-9']
name: Built-Item Test (${{matrix.os}})
runs-on: ${{ matrix.os == 'centos-9' && 'ubuntu-24.04' || matrix.os }}
container: ${{ matrix.os == 'centos-9' && 'quay.io/centos/centos:stream9' || null }}
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 build-essential patch autoconf libtool \
flex libfl-dev bison libpcre2-dev civetweb libcivetweb-dev libssl-dev libcjson-dev libsystemd-dev \
binutils \
valgrind gcovr xmlstarlet python3-venv
- 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 autoconf libtool \
flex libfl-static bison pcre2-devel civetweb civetweb-devel openssl-devel cjson-devel systemd-devel \
binutils \
valgrind xmlstarlet python3-pip \
python3.11
pip3 install gcovr
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: ccache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
- name: Dependencies
run: ./deps.sh
- name: Prep
run: ./prep.sh -DBUILD_DOCS_API=OFF -DBUILD_DOCS_MAN=OFF -DBUILD_TESTING=OFF
- name: Build
run: ./build.sh
- name: Install
run: ./build.sh install
- name: Check symbols
run: ./check_symbols.py cace refda refdm
- name: Test
env:
PYTHON: ${{ matrix.os == 'centos-9' && 'python3.11' || 'python3' }}
run: ./item-test/run.sh
integration-test:
strategy:
fail-fast: false
matrix:
transport: ['socket', 'ion']
name: Integration Test (${{matrix.transport}})
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Start
run: ./integration-test-${{matrix.transport}}/run.sh start
- name: Test
run: ./integration-test-${{matrix.transport}}/run.sh check
- name: Stop
if: always()
run: ./integration-test-${{matrix.transport}}/run.sh stop