Skip to content

Add security policy #336

Add security policy

Add security policy #336

Workflow file for this run

name: "Krnlmon CI Pipeline"
on:
push:
branches:
- main
pull_request:
branches:
- main
- mev-ts*
workflow_dispatch:
concurrency:
# If workflow for PR or push is already running, stop it and start a new one.
group: build-${{ github.ref }}
cancel-in-progress: true
env:
#---------------------------------------------------------------------
# Environment variables
#---------------------------------------------------------------------
SDE_REPOSITORY: ipdk-io/p4dev.dpdk-sde
SDE_TAG: 2023.10.1
SDE_FILENAME: dpdk-sde-dev-ubuntu-20.04.tar.gz
SDE_INSTALL_DIR: /opt/p4dev/dpdk-sde
DEPS_REPOSITORY: ipdk-io/stratum-deps
DEPS_TAG: v1.2.1
DEPS_FILENAME: deps-ubuntu-latest-x86_64.tar.gz
DEPS_INSTALL_DIR: /opt/p4dev/x86deps
PREREQS: libbsd-dev libnl-3-dev libnl-route-3-dev libnl-genl-3-dev
jobs:
#---------------------------------------------------------------------
# 1 - dpdk_build_check
#---------------------------------------------------------------------
dpdk_build_check:
runs-on: ubuntu-latest
steps:
- name: Check out networking-recipe
uses: actions/checkout@v4
with:
repository: ipdk-io/networking-recipe
submodules: recursive
path: recipe
- name: Install dpdk-sde
uses: robinraju/[email protected]
with:
repository: ${{ env.SDE_REPOSITORY }}
tag: ${{ env.SDE_TAG }}
fileName: ${{ env.SDE_FILENAME }}
- run: |
sudo tar -xzf $SDE_FILENAME -C /
rm $SDE_FILENAME
- name: Install stratum-deps
uses: robinraju/[email protected]
with:
repository: ${{ env.DEPS_REPOSITORY }}
tag: ${{ env.DEPS_TAG }}
fileName: ${{ env.DEPS_FILENAME }}
- run: |
sudo tar -xzf $DEPS_FILENAME -C /
rm $DEPS_FILENAME
- name: Install prerequisites
run: |
sudo apt install $PREREQS
- name: Build krnlmon
working-directory: recipe
run: |
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
export SDE_INSTALL=$SDE_INSTALL_DIR
./make-all.sh --target=dpdk --rpath --no-ovs --no-build
cmake --build build -j4 --target krnlmon
#---------------------------------------------------------------------
# 2 - dpdk_unit_tests
#---------------------------------------------------------------------
dpdk_unit_tests:
runs-on: ubuntu-latest
steps:
- name: Check out networking-recipe
uses: actions/checkout@v4
with:
repository: ipdk-io/networking-recipe
submodules: recursive
path: recipe
- name: Install dpdk-sde
uses: robinraju/[email protected]
with:
repository: ${{ env.SDE_REPOSITORY }}
tag: ${{ env.SDE_TAG }}
fileName: ${{ env.SDE_FILENAME }}
- run: |
sudo tar -xzf $SDE_FILENAME -C /
rm $SDE_FILENAME
- name: Install stratum-deps
uses: robinraju/[email protected]
with:
repository: ${{ env.DEPS_REPOSITORY }}
tag: ${{ env.DEPS_TAG }}
fileName: ${{ env.DEPS_FILENAME }}
- run: |
sudo tar -xzf $DEPS_FILENAME -C /
rm $DEPS_FILENAME
- name: Install prerequisites
run: |
sudo apt install $PREREQS
- name: Run dpdk unit tests
working-directory: recipe
run: |
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
export SDE_INSTALL=$SDE_INSTALL_DIR
./make-all.sh --target=dpdk --no-ovs --no-build
cmake --build build --target krnlmon-test
#---------------------------------------------------------------------
# check_clang_format
#---------------------------------------------------------------------
check_clang_format:
runs-on: ubuntu-latest
steps:
- name: Check out krnlmon repository
uses: actions/checkout@v4
- name: Get list of changed Files
id: changed
uses: tj-actions/changed-files@v45
with:
files: |
**.c
**.h
**.cc
- name: Check for formatting errors
if: steps.changed.outputs.any_changed == 'true'
run: |
clang-format -n -Werror ${{ steps.changed.outputs.all_changed_files }}