.github: allow manual start of workflow #130
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@v4 | |
- 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 | |
if [ "$CC" = "clang" ]; then | |
compat_valgrind="-gdwarf-4" | |
fi | |
./configure $OPTS CFLAGS="$compat_valgrind" | |
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 CFLAGS="$compat_valgrind" | |
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@v4 | |
with: | |
name: smcroute-test-${{ matrix.compiler }} | |
path: test/* |