-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a github action to build uci and then execute the tests. This first builds and installs libubox and then uses that dependency to build and test uci. clang 14 generates debug information in DWARF 5 format, but valgrind 19.0 does not support that. Install valgrind 20.0 from experimental which supports it. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: 'Run tests' | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build_test: | ||
strategy: | ||
matrix: | ||
include: | ||
- compiler: "-DCMAKE_C_COMPILER=clang" | ||
- compiler: "-DCMAKE_C_COMPILER=gcc" | ||
|
||
name: Build and run tests | ||
runs-on: ubuntu-latest | ||
container: | ||
image: debian:bookworm | ||
|
||
steps: | ||
|
||
- name: Add Debian experimental | ||
run: | | ||
echo "deb http://deb.debian.org/debian/ experimental main" >> /etc/apt/sources.list | ||
- name: Install compiler | ||
run: | | ||
apt update | ||
apt install -y cmake build-essential lua5.1 pkgconf libjson-c-dev liblua5.1-0-dev python3.11-venv clang libc++abi-dev libc++-dev | ||
apt -t experimental install -y valgrind | ||
useradd -ms /bin/bash buildbot | ||
- name: Checkout libubox | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: openwrt/libubox | ||
path: libubox | ||
|
||
- name: Checkout uci | ||
uses: actions/checkout@v3 | ||
with: | ||
path: uci | ||
|
||
- name: Create build directory | ||
run: mkdir libubox-build | ||
|
||
- name: Create build directory | ||
run: mkdir uci-build | ||
|
||
- name: Create install directory | ||
run: mkdir install | ||
|
||
- name: Fix permission | ||
run: chown -R buildbot:buildbot libubox-build libubox uci uci-build install | ||
|
||
- name: Run cmake (libubox) | ||
shell: su buildbot -c "sh -e {0}" | ||
working-directory: libubox-build | ||
run: cmake ../libubox -DCMAKE_INSTALL_PREFIX=../install -DBUILD_LUA=false ${{ matrix.compiler }} | ||
|
||
- name: Run build (libubox) | ||
shell: su buildbot -c "sh -e {0}" | ||
working-directory: libubox-build | ||
run: make | ||
|
||
- name: Run install (libubox) | ||
shell: su buildbot -c "sh -e {0}" | ||
working-directory: libubox-build | ||
run: make install | ||
|
||
- name: Run cmake (uci) | ||
shell: su buildbot -c "sh -e {0}" | ||
working-directory: uci-build | ||
run: cmake ../uci -DUNIT_TESTING=true -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_PREFIX_PATH=../install ${{ matrix.compiler }} | ||
|
||
- name: Run build (uci) | ||
shell: su buildbot -c "sh -e {0}" | ||
working-directory: uci-build | ||
run: make | ||
|
||
- name: Run tests (uci) | ||
shell: su buildbot -c "sh -e {0}" | ||
working-directory: uci-build | ||
run: make test |