Skip to content

Commit ed9b274

Browse files
committed
build and run unit tests with meson in GitHub workflow
1 parent 6ff70f1 commit ed9b274

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/cpp.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
- 'main'
2424

2525
env:
26-
APT_PACKAGES: libspdlog-dev libpcap-dev libevdev2 libev-dev protobuf-compiler libgtest-dev libgmock-dev
26+
APT_PACKAGES: libspdlog-dev libpcap-dev libevdev2 libev-dev protobuf-compiler libgtest-dev libgmock-dev meson ninja-build
2727

2828
jobs:
2929
unit_tests:
@@ -49,6 +49,32 @@ jobs:
4949
name: piscsi_test_log.txt
5050
path: cpp/piscsi_test_log.txt
5151

52+
unit_tests_meson:
53+
runs-on: ubuntu-24.04
54+
defaults:
55+
run:
56+
working-directory: .
57+
steps:
58+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
59+
60+
- name: Install dependencies
61+
run: sudo apt-get install ${{ env.APT_PACKAGES }}
62+
63+
- name: Configure build
64+
run: meson setup build
65+
66+
- name: Build unit tests
67+
run: meson compile -C build
68+
69+
- name: Run unit tests
70+
run: meson test -C build
71+
72+
- name: Upload logs
73+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
74+
with:
75+
name: testlog.txt
76+
path: build/meson-logs/testlog.txt
77+
5278
sonarcloud:
5379
runs-on: ubuntu-24.04
5480
if: >

0 commit comments

Comments
 (0)