Skip to content

Build and Test

Build and Test #85

Workflow file for this run

name: Build and Test
on:
push:
pull_request:
jobs:
build-linux:
env:
dependencies: |
automake libtool gcc bc libssl-dev llvm-dev libelf-dev \
libnuma-dev libpcap-dev ncat libunbound-dev libunwind-dev \
libudev-dev python3-scapy
CC: ${{ matrix.compiler }}
TESTSUITE: ${{ matrix.testsuite }}
ASAN: ${{ matrix.asan }}
name: linux ${{ join(matrix.*, ' ') }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- compiler: gcc
- compiler: clang
- compiler: clang
testsuite: test
asan: asan
steps:
- name: checkout self
uses: actions/checkout@v3
- name: checkout OVN
uses: actions/checkout@v3
with:
repository: 'ovn-org/ovn'
path: 'ovn'
# The `base_ref` will only be set for PR and contain the name of the
# target branch. The `ref_name` will be correct for the final push
# check after a PR is merged.
#
# This setup may lead to failures on push to arbitrarily named branches
# on a fork, but that is a price worth paying.
#
# Contributors can raise a draft PR to get accurate results.
ref: ${{ github.base_ref || github.ref_name }}
submodules: recursive
- name: dependencies
run: |
set -euxo pipefail
sudo apt update
sudo apt remove -y netcat-openbsd
sudo apt -y install ${{ env.dependencies }}
- name: build OVS
run: |
set -euxo pipefail
pushd ovn/ovs
./boot.sh && ./configure || { cat config.log; exit 1; }
make -j4 || { cat config.log; exit 1; }
popd
- name: configure OVN
run: |
set -euxo pipefail
pushd ovn
./boot.sh && ./configure \
|| { cat config.log; exit 1; }
popd
- name: build ovn-vif
run: |
set -euxo pipefail
./boot.sh && ./configure \
--with-ovs-source=./ovn/ovs \
--with-ovn-source=./ovn \
--enable-plug-representor \
|| { cat config.log; exit 1; }
make -j4 || { cat config.log; exit 1; }
- name: OVN VIF testsuite - test
if: matrix.testsuite == 'test'
run: |
set -euxo pipefail
if [ "$ASAN" ]; then
export CFLAGS="-fno-omit-frame-pointer -fno-common"
export OVN_CFLAGS="-fsanitize=address"
fi
export DISTCHECK_CONFIGURE_FLAGS="--with-ovs-source=$(realpath ./ovn/ovs) --with-ovn-source=$(realpath ./ovn) --enable-plug-representor"
make distcheck -j4 TESTSUITEFLAGS="-j4" RECHECK=yes \
|| { cat */_build/sub/tests/testsuite.log ; exit 1; }
- name: re-configure and build OVN
run: |
set -euxo pipefail
pushd ovn
./boot.sh && ./configure \
--with-ovs-source=$(realpath ./ovs) \
--with-vif-plug-provider=$(realpath ../) \
|| { cat config.log; exit 1; }
make -j4 || { cat config.log; exit 1; }
popd
- name: OVN testsuite - test
if: matrix.testsuite == 'test'
run: |
set -euxo pipefail
pushd ovn
if [ "$ASAN" ]; then
export CFLAGS="-fno-omit-frame-pointer -fno-common"
export OVN_CFLAGS="-fsanitize=address"
fi
export DISTCHECK_CONFIGURE_FLAGS="--with-ovs-source=$(realpath ./ovs) --with-plug-provider=$(realpath ../)"
make distcheck -j4 TESTSUITEFLAGS="-j4" RECHECK=yes \
|| { cat */_build/sub/tests/testsuite.log ; exit 1; }
popd