|
| 1 | +name: NetworkManager • wolfSSL / GnuTLS CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master, main ] |
| 6 | + pull_request: |
| 7 | + branches: [ '*' ] |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + nm-wolfssl-gnutls: |
| 15 | + runs-on: ubuntu-22.04 |
| 16 | + timeout-minutes: 60 |
| 17 | + |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + nm_version: [ master, "1.52.0", "1.42.4" ] |
| 22 | + |
| 23 | + steps: |
| 24 | + # ────────────────────────── checkout + packages ───────────────────────── |
| 25 | + - name: Checkout repo |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + fetch-depth: 0 |
| 29 | + |
| 30 | + - name: Install build dependencies |
| 31 | + run: | |
| 32 | + sudo apt-get update -qq |
| 33 | + sudo apt-get install --yes --no-install-recommends \ |
| 34 | + autoconf automake libtool m4 pkg-config build-essential git \ |
| 35 | + meson ninja-build gettext clang gperf gnulib autopoint gtk-doc-tools \ |
| 36 | + nettle-dev libtasn1-bin libtasn1-6-dev libunistring-dev libnvme-dev \ |
| 37 | + libp11-kit-dev libunbound-dev bison python3-yaml \ |
| 38 | + debhelper debugedit dh-autoreconf dh-strip-nondeterminism dwz intltool \ |
| 39 | + libbluetooth-dev libdebhelper-perl libndp-dev \ |
| 40 | + libfile-stripnondeterminism-perl libglib2.0-doc \ |
| 41 | + libnewt-dev libnl-3-dev libnl-cli-3-200 libnl-nf-3-200 libgirepository1.0-dev \ |
| 42 | + libpolkit-agent-1-dev libslang2-dev libsub-override-perl libdbus-1-dev ppp ppp-dev mobile-broadband-provider-info \ |
| 43 | + libteam-dev libteam5 libyaml-perl po-debconf libaudit-dev libudev-dev libsystemd-dev libmm-glib-dev libjansson-dev dhcpcd5 dnsmasq-base libpsl-dev libreadline-dev valac |
| 44 | +
|
| 45 | + - name: Build forked GnuTLS stack |
| 46 | + run: | |
| 47 | + LOGGING=0 GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh |
| 48 | + test -d /opt/gnutls && test -d /opt/wolfssl |
| 49 | +
|
| 50 | + - name: Build curl 7.88.1 (GnuTLS backend) |
| 51 | + run: | |
| 52 | + git clone --branch curl-7_88_1 https://github.com/curl/curl |
| 53 | + cd curl |
| 54 | + autoreconf -fi |
| 55 | + ./configure --with-gnutls=/opt/gnutls --prefix=/opt/curl \ |
| 56 | + --disable-static --enable-shared |
| 57 | + make -j"$(nproc)" |
| 58 | + sudo make install |
| 59 | + sudo ldconfig |
| 60 | +
|
| 61 | + - name: Clone NetworkManager ${{ matrix.nm_version }} |
| 62 | + run: | |
| 63 | + git clone https://github.com/NetworkManager/NetworkManager |
| 64 | + cd NetworkManager |
| 65 | + if [ "${{ matrix.nm_version }}" != "master" ]; then |
| 66 | + git checkout "${{ matrix.nm_version }}" |
| 67 | + fi |
| 68 | +
|
| 69 | + - name: Configure & build NetworkManager |
| 70 | + working-directory: NetworkManager |
| 71 | + run: | |
| 72 | + export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/curl/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" |
| 73 | + export CPPFLAGS="-I/opt/gnutls/include -I/opt/curl/include${CPPFLAGS:+ $CPPFLAGS}" |
| 74 | + export LDFLAGS="-L/opt/gnutls/lib -L/opt/curl/lib -Wl,-rpath,/opt/gnutls/lib:/opt/curl/lib${LDFLAGS:+ $LDFLAGS}" |
| 75 | + export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/curl/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" |
| 76 | +
|
| 77 | + if [ "${{ matrix.nm_version }}" != "master" ]; then |
| 78 | + meson setup build-gnutls \ |
| 79 | + -Dcrypto=gnutls \ |
| 80 | + -Dtests=yes \ |
| 81 | + -Dsystemd_journal=true \ |
| 82 | + -Dmore_logging=true \ |
| 83 | + -Dqt=false |
| 84 | + else |
| 85 | + meson setup build-gnutls \ |
| 86 | + -Dcrypto=gnutls \ |
| 87 | + -Dtests=yes \ |
| 88 | + -Dsystemd_journal=true \ |
| 89 | + -Dmore_logging=true \ |
| 90 | + -Dqt=false \ |
| 91 | + -Dnbft=false |
| 92 | + fi |
| 93 | +
|
| 94 | + ninja -C build-gnutls -j"$(nproc)" |
| 95 | +
|
| 96 | + # ───────────────────── verify linkage (before tests) ──────────────────── |
| 97 | + - name: Verify linkage to /opt/gnutls |
| 98 | + working-directory: NetworkManager/build-gnutls |
| 99 | + run: | |
| 100 | + BIN=src/nmcli/nmcli |
| 101 | + LIB=$(find src/libnm-client-impl -name 'libnm.so*' -type f | head -n1) |
| 102 | + for obj in "$BIN" "$LIB"; do |
| 103 | + echo "::group::ldd $obj" |
| 104 | + ldd "$obj" | grep -E 'lib(curl|gnutls)' |
| 105 | + echo "::endgroup::" |
| 106 | + ldd "$obj" | grep -q '/opt/gnutls/lib/libgnutls.so.30' || exit 1 |
| 107 | + done |
| 108 | +
|
| 109 | + # ────────────────────────── run test-suite ────────────────────────────── |
| 110 | + - name: Run NetworkManager tests |
| 111 | + working-directory: NetworkManager |
| 112 | + run: | |
| 113 | + export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/curl/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" |
| 114 | + export CPPFLAGS="-I/opt/gnutls/include -I/opt/curl/include${CPPFLAGS:+ $CPPFLAGS}" |
| 115 | + export LDFLAGS="-L/opt/gnutls/lib -L/opt/curl/lib -Wl,-rpath,/opt/gnutls/lib:/opt/curl/lib${LDFLAGS:+ $LDFLAGS}" |
| 116 | + export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/curl/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" |
| 117 | + export NM_TEST_REGENERATE=1 |
| 118 | +
|
| 119 | + if [ "${{ matrix.nm_version }}" != "1.42.4" ]; then |
| 120 | + ninja -C build-gnutls test |
| 121 | + else |
| 122 | + # Skipped on CI because the GitHub Actions kernel lacks the VRF/Team modules and QoS-mapping support that platform/test-link-linux expects, so the test aborts with “Unknown device type / xgress QoS mapping assertion. |
| 123 | + # Doesn't test any TLS/Crypto capabilities. |
| 124 | + cd build-gnutls |
| 125 | + all_tests=$(meson test --list 2>/dev/null) |
| 126 | + test_list=$(printf '%s\n' "$all_tests" \ |
| 127 | + | grep -v -E '^(platform/test-link-linux)$' \ |
| 128 | + | tr '\n' ' ') |
| 129 | + meson test $test_list --print-errorlogs |
| 130 | + fi |
0 commit comments