[pull] dev from ntop:dev #968
This file contains hidden or 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: ARM builds with docker | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - dev | |
| pull_request: | |
| branches: | |
| - dev | |
| types: [opened, synchronize, reopened] | |
| release: | |
| types: [created] | |
| schedule: | |
| # At the end of every day | |
| - cron: '0 0 * * *' | |
| jobs: | |
| test: | |
| name: Ubuntu ${{ matrix.arch }} | |
| runs-on: ubuntu-latest | |
| env: | |
| CFLAGS: -Werror -DNDPI_EXTENDED_SANITY_CHECKS | |
| # Idea to have significant faster tests while pushing/merging: test all pcaps only on schedule runs; otherwise tests only the pcaps updated/added recently | |
| NDPI_TEST_ONLY_RECENTLY_UPDATED_PCAPS: ${{ (github.event_name == 'schedule') && '0' || '1' }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| arch: ["armhf", "s390x"] | |
| steps: | |
| - name: Setup multiarch/qemu-user-static | |
| run: | | |
| docker run --rm --privileged multiarch/qemu-user-static:register --reset | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Display qemu specified architecture (armhf - little endian) | |
| if: startsWith(matrix.arch, 'armhf') | |
| uses: docker://multiarch/ubuntu-core:armhf-focal | |
| with: | |
| args: > | |
| bash -c | |
| "uname -a && | |
| lscpu | grep Endian | |
| " | |
| - name: Configure, compile and test using qemu for the specified architecture (armhf - little endian) | |
| if: startsWith(matrix.arch, 'armhf') | |
| # Use docker run with --privileged to allow tmpfs mount. | |
| # This works around QEMU bug #1805913 where readdir() returns EOVERFLOW | |
| # for 32-bit ARM emulation on 64-bit hosts due to large inode numbers. | |
| # Since we need to load files from two directories (lists and plugins) the simpler | |
| # solution is to make an out-of-tree build in a tmpfs and run the tests directly from there | |
| # See: https://bugs.launchpad.net/qemu/+bug/1805913 | |
| run: | | |
| docker run --rm --privileged -v $(pwd):/src:ro \ | |
| -e NDPI_TEST_ONLY_RECENTLY_UPDATED_PCAPS=$NDPI_TEST_ONLY_RECENTLY_UPDATED_PCAPS \ | |
| -e CFLAGS="$CFLAGS" \ | |
| multiarch/ubuntu-core:armhf-focal bash -c " | |
| apt-get -y update && | |
| DEBIAN_FRONTEND=noninteractive apt-get -y install make git wdiff colordiff autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev rrdtool librrd-dev && | |
| mkdir -p /build && | |
| mount -t tmpfs tmpfs /build && | |
| cp -a /src/. /build/ && | |
| cd /build && | |
| git config --global --add safe.directory /build && | |
| env CC=gcc ./autogen.sh && ./configure --enable-option-checking=fatal --enable-debug-messages && | |
| make -j \$(nproc) all && | |
| make -C example ndpiSimpleIntegration && | |
| make -C rrdtool && | |
| make check VERBOSE=1 | |
| " | |
| - name: Display qemu specified architecture (s390x - big endian) | |
| if: startsWith(matrix.arch, 's390x') | |
| uses: docker://multiarch/ubuntu-core:s390x-focal | |
| with: | |
| args: > | |
| bash -c | |
| "uname -a && | |
| lscpu | grep Endian | |
| " | |
| - name: Configure and compile using qemu for the specified architecture (s390x - big endian) | |
| if: startsWith(matrix.arch, 's390x') | |
| uses: docker://multiarch/ubuntu-core:s390x-focal | |
| with: | |
| args: > | |
| bash -c | |
| "apt-get -y update && | |
| DEBIAN_FRONTEND=noninteractive apt-get -y install make git wdiff colordiff autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev rrdtool librrd-dev && | |
| git config --global --add safe.directory $(realpath .) && | |
| env CC=gcc ./autogen.sh && ./configure --enable-option-checking=fatal --enable-debug-messages && | |
| make -j $(nproc) all && | |
| make -C example ndpiSimpleIntegration && | |
| make -C rrdtool && | |
| make check VERBOSE=1 | |
| " | |