-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (54 loc) · 1.73 KB
/
build-and-test.yml
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
name: Build and Test
on: [ push, workflow_dispatch, pull_request ]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
curl \
git \
libcmocka-dev \
libcurl4-openssl-dev \
libesmtp-dev \
libjson-c-dev \
liblog4c-dev \
libmnl-dev \
libsqlite3-0 \
libsqlite3-dev \
libssl-dev \
ninja-build \
pkg-config \
python-is-python3 \
python3-pip \
python3-venv \
sqlite3
- name: checkout and build dependecies
run: ci/install_deps.py -G
- name: Build ${{ matrix.build_type }}
env:
DESTDIR: ${{ github.workspace }}/build/${{ matrix.build_type }}/dist
run: |
cmake -B ./build/${{ matrix.build_type }}/cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
make -C ./build/${{ matrix.build_type }}/cmake all install
- name: save build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build_type }}-build
path: build/${{ matrix.build_type}}/dist
- name: run unit tests (${{ matrix.build_type }})
run: ci/run_utest.sh ${{ matrix.build_type }}
- name: save ${{ matrix.build_type }} unit test report
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.build_type }}-test-report
path: build/${{ matrix.build_type }}/result/unit_test/