Skip to content

Fix typo on tool readme #8

Fix typo on tool readme

Fix typo on tool readme #8

name: lint, compile, verify and publish
on:
push:
branches: main
pull_request:
env:
PYTHON_VERSION: "3.10"
jobs:
list-nfs:
runs-on: ubuntu-latest
outputs:
nfs: ${{ steps.list-nfs.outputs.nfs }}
steps:
- uses: actions/checkout@v3
- id: list-nfs
name: list nfs
run: |
nfs_json=$(
find nf -mindepth 1 -maxdepth 1 -type d |
cut -d/ -f2 |
xargs |
sed 's/ /","/g'
)
echo "nfs=[\"$nfs_json\"]" >> $GITHUB_OUTPUT
lint-env-and-nf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jidicula/[email protected]
# TODO lint-tool
# TODO document-env
compile-nf:
needs: [list-nfs, lint-env-and-nf]
runs-on: ubuntu-latest
strategy:
matrix:
nf: ${{ fromJSON(needs.list-nfs.outputs.nfs) }}
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
if: matrix.nf == 'rust-policer'
with:
toolchain: nightly
components: rust-src
- run: make compile-${{ matrix.nf }}
build-nf:
needs: [list-nfs, compile-nf]
runs-on: ubuntu-latest
strategy:
matrix:
nf: ${{ fromJSON(needs.list-nfs.outputs.nfs) }}
os: [linux, metal, dpdk]
net: [tinynf, dpdk]
exclude:
- os: dpdk
net: tinynf
- os: metal
net: dpdk
# TODO need lpm_*
- nf: router
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
if: matrix.nf == 'rust-policer'
with:
toolchain: nightly
components: rust-src
- name: install DPDK deps
if: matrix.net == 'dpdk'
run: |
sudo apt update
sudo apt install libnuma-dev
- name: create dummy OS config
run: echo '{.bus = 0x00, .device = 0x00, .function = 0x0}' > env/config
- run: make OS=${{ matrix.os }} NET=${{ matrix.net }} build-${{ matrix.nf }}
test-tool:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: 'tool/pyproject.toml'
- run: make tool-test
verify-nf:
needs: [list-nfs, build-nf, test-tool]
runs-on: ubuntu-latest
strategy:
matrix:
nf: ${{ fromJSON(needs.list-nfs.outputs.nfs) }}
exclude:
# TODO inf recursion?
- nf: dhcp_ipv4
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: 'tool/pyproject.toml'
- uses: actions-rust-lang/setup-rust-toolchain@v1
if: matrix.nf == 'rust-policer'
with:
toolchain: nightly
components: rust-src
- run: make verify-${{ matrix.nf }}
env:
CFLAGS: -mno-avx512f -mno-avx512vl # angr>vex doesn't support some avx512
publish-tool:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [test-tool, verify-nf]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: 'tool/pyproject.toml'
- run: make tool-build
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: tool/dist