summaryrefslogtreecommitdiff
path: root/.github/workflows/build-and-test.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build-and-test.yml')
-rw-r--r--.github/workflows/build-and-test.yml89
1 files changed, 72 insertions, 17 deletions
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index 39649c1b5..f66ab43b0 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -3,12 +3,80 @@ name: Build and Test
on: [push, pull_request]
jobs:
+ build-dpdk:
+ env:
+ dependencies: gcc libnuma-dev ninja-build
+ CC: gcc
+ DPDK_GIT: https://dpdk.org/git/dpdk-stable
+ DPDK_VER: 22.11.1
+ name: dpdk gcc
+ outputs:
+ dpdk_key: ${{ steps.gen_dpdk_key.outputs.key }}
+ runs-on: ubuntu-20.04
+ timeout-minutes: 30
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v3
+
+ - name: update PATH
+ run: |
+ echo "$HOME/bin" >> $GITHUB_PATH
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: create ci signature file for the dpdk cache key
+ # This will collect most of DPDK related lines, so hash will be different
+ # if something changed in a way we're building DPDK including DPDK_VER.
+ # This also allows us to use cache from any branch as long as version
+ # and a way we're building DPDK stays the same.
+ run: |
+ grep -irE 'RTE_|DPDK|meson|ninja' .ci/dpdk-* > dpdk-ci-signature
+ grep -rwE 'DPDK_GIT|DPDK_VER' .github/ >> dpdk-ci-signature
+ if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
+ git ls-remote --heads $DPDK_GIT $DPDK_VER >> dpdk-ci-signature
+ fi
+ cat dpdk-ci-signature
+
+ - name: generate ci DPDK key
+ id: gen_dpdk_key
+ env:
+ ci_key: ${{ hashFiles('dpdk-ci-signature') }}
+ run: echo 'key=dpdk-${{ env.ci_key }}' >> $GITHUB_OUTPUT
+
+ - name: cache
+ id: dpdk_cache
+ uses: actions/cache@v3
+ with:
+ path: dpdk-dir
+ key: ${{ steps.gen_dpdk_key.outputs.key }}
+
+ - name: set up python
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.9'
+
+ - name: update APT cache
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
+ run: sudo apt update || true
+ - name: install common dependencies
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
+ run: sudo apt install -y ${{ env.dependencies }}
+
+ - name: prepare
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
+ run: ./.ci/dpdk-prepare.sh
+
+ - name: build
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
+ run: ./.ci/dpdk-build.sh
+
build-linux:
+ needs: build-dpdk
env:
dependencies: |
- automake libtool gcc bc libjemalloc2 libjemalloc-dev \
- libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev \
- ninja-build selinux-policy-dev libbpf-dev
+ automake libtool gcc bc libjemalloc2 libjemalloc-dev libssl-dev \
+ llvm-dev libnuma-dev libpcap-dev selinux-policy-dev libbpf-dev
ASAN: ${{ matrix.asan }}
UBSAN: ${{ matrix.ubsan }}
CC: ${{ matrix.compiler }}
@@ -104,25 +172,12 @@ jobs:
with:
python-version: '3.9'
- - name: create ci signature file for the dpdk cache key
- if: matrix.dpdk != '' || matrix.dpdk_shared != ''
- # This will collect most of DPDK related lines, so hash will be different
- # if something changed in a way we're building DPDK including DPDK_VER.
- # This also allows us to use cache from any branch as long as version
- # and a way we're building DPDK stays the same.
- run: |
- grep -irE 'RTE_|DPDK|meson|ninja' -r .ci/ > dpdk-ci-signature
- cat dpdk-ci-signature
-
- name: cache
if: matrix.dpdk != '' || matrix.dpdk_shared != ''
uses: actions/cache@v3
- env:
- matrix_key: ${{ matrix.dpdk }}${{ matrix.dpdk_shared }}
- ci_key: ${{ hashFiles('dpdk-ci-signature') }}
with:
path: dpdk-dir
- key: ${{ env.matrix_key }}-${{ env.ci_key }}
+ key: ${{ needs.build-dpdk.outputs.dpdk_key }}
- name: update APT cache
run: sudo apt update || true