test: refactor mrcache.sh to handle both IPv4 and IPv6 #120
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
name: Bob the Builder | |
# Run on all branches, including all pull requests, except the 'dev' | |
# branch since that's where we run Coverity Scan (limited tokens/day) | |
on: | |
push: | |
branches: | |
- '**' | |
- '!dev' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build: | |
# Verify we can build on latest Ubuntu with both gcc and clang | |
name: ${{ matrix.compiler }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
compiler: [gcc, clang] | |
fail-fast: false | |
env: | |
MAKEFLAGS: -j3 | |
CC: ${{ matrix.compiler }} | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo modprobe ip_gre | |
sudo apt-get -y update | |
sudo apt-get -y install pkg-config libsystemd-dev libcap-dev tshark iptables valgrind | |
- uses: actions/checkout@v3 | |
- name: Configure | |
# Build in a sub-directory so we can safely set a+w on all | |
# directories. Needed for `make check` since it runs with | |
# root dropped and wants to write .trs and .log files. | |
run: | | |
set -x | |
OPTS="--cache-file=/tmp/config.cache --prefix= --enable-mrdisc --enable-test" | |
./autogen.sh | |
./configure $OPTS | |
make dist && archive=$(ls *.tar.gz) | |
if [ -n "$archive" -a -f "$archive" ]; then | |
tar xf "$archive" | |
dir=$(echo "$archive" |rev |cut -f3- -d. |rev) | |
cd "$dir" | |
fi | |
mkdir -p .build/dir | |
cd .build/dir | |
../../configure $OPTS | |
chmod -R a+w . | |
- name: Build | |
run: | | |
make | |
- name: Install to ~/tmp and Inspect | |
run: | | |
DESTDIR=~/tmp make install-strip | |
tree ~/tmp | |
ldd ~/tmp/sbin/smcrouted | |
size ~/tmp/sbin/smcrouted | |
ldd ~/tmp/sbin/smcroutectl | |
size ~/tmp/sbin/smcroutectl | |
~/tmp/sbin/smcrouted -h | |
~/tmp/sbin/smcroutectl -h | |
- name: Run Unit Tests | |
run: | | |
make check || (cat test/test-suite.log; false) | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: smcroute-test-${{ matrix.compiler }} | |
path: test/* |