diff --git a/.github/actions/install-apt-deps/action.yml b/.github/actions/install-apt-deps/action.yml new file mode 100644 index 0000000000..200df0821a --- /dev/null +++ b/.github/actions/install-apt-deps/action.yml @@ -0,0 +1,92 @@ +name: 'Install apt dependencies' +description: 'Install apt packages with retry logic and caching' +inputs: + packages: + description: 'Space-separated list of apt packages to install' + required: true + retries: + description: 'Number of retry attempts' + required: false + default: '3' + retry-delay: + description: 'Initial delay between retries (seconds, doubles each attempt)' + required: false + default: '5' + no-install-recommends: + description: 'Pass --no-install-recommends to apt-get install' + required: false + default: 'false' + cache: + description: 'Cache apt archives (disable for dynamic package names)' + required: false + default: 'true' +runs: + using: 'composite' + steps: + - name: Compute cache key + if: inputs.cache == 'true' + id: cache-key + shell: bash + run: | + SORTED_PKGS=$(echo "${{ inputs.packages }}" | tr ' ' '\n' | sort | tr '\n' ' ') + PKG_HASH=$(echo "$SORTED_PKGS" | sha256sum | cut -d' ' -f1 | head -c 16) + OS_VERSION=$(lsb_release -rs 2>/dev/null || echo "unknown") + echo "key=apt-deps-${{ runner.os }}-${{ runner.arch }}-${OS_VERSION}-${PKG_HASH}" >> $GITHUB_OUTPUT + echo "restore-key=apt-deps-${{ runner.os }}-${{ runner.arch }}-${OS_VERSION}-" >> $GITHUB_OUTPUT + + - name: Restore apt cache + if: inputs.cache == 'true' + id: apt-cache + uses: actions/cache/restore@v4 + with: + path: ~/apt-cache + key: ${{ steps.cache-key.outputs.key }} + restore-keys: ${{ steps.cache-key.outputs.restore-key }} + + - name: Pre-seed apt archives from cache + if: inputs.cache == 'true' && steps.apt-cache.outputs.cache-hit == 'true' + shell: bash + run: | + if [ -d ~/apt-cache ] && ls ~/apt-cache/*.deb >/dev/null 2>&1; then + sudo cp ~/apt-cache/*.deb /var/cache/apt/archives/ + echo "Restored $(ls ~/apt-cache/*.deb | wc -l) cached .deb files" + fi + + - name: Install packages + shell: bash + run: | + export DEBIAN_FRONTEND=noninteractive + RETRIES=${{ inputs.retries }} + DELAY=${{ inputs.retry-delay }} + NO_REC="" + if [ "${{ inputs.no-install-recommends }}" = "true" ]; then + NO_REC="--no-install-recommends" + fi + for i in $(seq 1 $RETRIES); do + if sudo apt-get update -q && \ + sudo apt-get install -y $NO_REC ${{ inputs.packages }}; then + exit 0 + fi + if [ "$i" -eq "$RETRIES" ]; then + echo "::error::apt-get failed after $RETRIES attempts" + exit 1 + fi + echo "::warning::apt-get failed (attempt $i/$RETRIES), retrying in ${DELAY}s..." + sleep $DELAY + DELAY=$((DELAY * 2)) + done + + - name: Collect .deb files for cache + if: inputs.cache == 'true' && steps.apt-cache.outputs.cache-hit != 'true' + shell: bash + run: | + mkdir -p ~/apt-cache + cp /var/cache/apt/archives/*.deb ~/apt-cache/ 2>/dev/null || true + echo "Cached $(ls ~/apt-cache/*.deb 2>/dev/null | wc -l) .deb files" + + - name: Save apt cache + if: inputs.cache == 'true' && steps.apt-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: ~/apt-cache + key: ${{ steps.cache-key.outputs.key }} diff --git a/.github/workflows/ada.yml b/.github/workflows/ada.yml index 8e892e69cc..e342f2a601 100644 --- a/.github/workflows/ada.yml +++ b/.github/workflows/ada.yml @@ -56,11 +56,14 @@ jobs: if: ${{ failure() && steps.examples.outcome == 'failure' }} run: cat ./wrapper/Ada/examples/server.log + - name: Install valgrind + uses: ./.github/actions/install-apt-deps + with: + packages: valgrind + - name: Run Ada wrapper tests (valgrind) working-directory: ./wrapper/Ada/tests run: | - sudo apt-get update - sudo apt-get install -y valgrind valgrind --leak-check=full --error-exitcode=1 \ --suppressions=valgrind.supp ./bin/tests diff --git a/.github/workflows/bind.yml b/.github/workflows/bind.yml index e4d3635b6e..340401a795 100644 --- a/.github/workflows/bind.yml +++ b/.github/workflows/bind.yml @@ -52,6 +52,12 @@ jobs: timeout-minutes: 10 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Download lib uses: actions/download-artifact@v4 with: @@ -61,12 +67,9 @@ jobs: run: tar -xf build-dir.tgz - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - # hostap dependencies - sudo apt-get install -y libuv1-dev libnghttp2-dev libcap-dev libcmocka-dev liburcu-dev + uses: ./.github/actions/install-apt-deps + with: + packages: libuv1-dev libnghttp2-dev libcap-dev libcmocka-dev liburcu-dev - name: Checkout OSP uses: actions/checkout@v4 diff --git a/.github/workflows/cmake-autoconf.yml b/.github/workflows/cmake-autoconf.yml index a29636ea75..f8a2c54e1e 100644 --- a/.github/workflows/cmake-autoconf.yml +++ b/.github/workflows/cmake-autoconf.yml @@ -15,11 +15,10 @@ jobs: # pull wolfSSL - uses: actions/checkout@v4 -# install cmake and autotools - - name: Install cmake - run: | - sudo apt-get update - sudo apt-get install -y cmake autoconf automake libtool + - name: Install cmake and autotools + uses: ./.github/actions/install-apt-deps + with: + packages: cmake autoconf automake libtool # build and install wolfssl via autotools for CMake consumer test - name: Build wolfssl with autotools diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8570fb5cac..4c80fcb33a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -15,11 +15,10 @@ jobs: # pull wolfSSL - uses: actions/checkout@v4 -# install cmake - name: Install cmake - run: | - sudo apt-get update - sudo apt-get install -y cmake + uses: ./.github/actions/install-apt-deps + with: + packages: cmake # build wolfssl - name: Build wolfssl diff --git a/.github/workflows/curl.yml b/.github/workflows/curl.yml index 26b7afa973..01a958ea0d 100644 --- a/.github/workflows/curl.yml +++ b/.github/workflows/curl.yml @@ -49,10 +49,16 @@ jobs: matrix: curl_ref: [ 'master', 'curl-8_4_0' ] steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install test dependencies - run: | - sudo apt-get update - sudo apt-get install nghttp2 libpsl5 libpsl-dev python3-impacket apache2 apache2-dev + uses: ./.github/actions/install-apt-deps + with: + packages: nghttp2 libpsl5 libpsl-dev python3-impacket apache2 apache2-dev - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/cyrus-sasl.yml b/.github/workflows/cyrus-sasl.yml index 2e5068d71c..55093c2651 100644 --- a/.github/workflows/cyrus-sasl.yml +++ b/.github/workflows/cyrus-sasl.yml @@ -53,13 +53,16 @@ jobs: timeout-minutes: 4 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install krb5-kdc krb5-otp libkrb5-dev \ - libsocket-wrapper libnss-wrapper krb5-admin-server libdb5.3-dev + uses: ./.github/actions/install-apt-deps + with: + packages: krb5-kdc krb5-otp libkrb5-dev libsocket-wrapper libnss-wrapper krb5-admin-server libdb5.3-dev - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/grpc.yml b/.github/workflows/grpc.yml index 019c57632a..51784048fd 100644 --- a/.github/workflows/grpc.yml +++ b/.github/workflows/grpc.yml @@ -62,9 +62,16 @@ jobs: ip addr list lo | grep 'inet ' ip addr list lo | grep 'inet6 ' + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install prereqs - run: - sudo apt-get install build-essential autoconf libtool pkg-config cmake clang libc++-dev + uses: ./.github/actions/install-apt-deps + with: + packages: build-essential autoconf libtool pkg-config cmake clang libc++-dev - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/haproxy.yml b/.github/workflows/haproxy.yml index 90b12b9365..277a476160 100644 --- a/.github/workflows/haproxy.yml +++ b/.github/workflows/haproxy.yml @@ -49,10 +49,16 @@ jobs: matrix: haproxy_ref: [ 'v3.1.0', 'v3.2.0'] steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install test dependencies - run: | - sudo apt-get update - sudo apt-get install libpcre2-dev + uses: ./.github/actions/install-apt-deps + with: + packages: libpcre2-dev - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/hostap-vm.yml b/.github/workflows/hostap-vm.yml index 56052f9ea4..fa286616f2 100644 --- a/.github/workflows/hostap-vm.yml +++ b/.github/workflows/hostap-vm.yml @@ -211,15 +211,12 @@ jobs: run: tar -xf build-dir.tgz - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - # hostap dependencies - sudo apt-get install -y libpcap0.8 libpcap-dev curl libcurl4-openssl-dev \ - libnl-3-dev binutils-dev libssl-dev libiberty-dev libnl-genl-3-dev \ - libnl-route-3-dev libdbus-1-dev bridge-utils tshark python3-pycryptodome - sudo pip install pycryptodome + uses: ./wolfssl/.github/actions/install-apt-deps + with: + packages: libpcap0.8 libpcap-dev curl libcurl4-openssl-dev libnl-3-dev binutils-dev libssl-dev libiberty-dev libnl-genl-3-dev libnl-route-3-dev libdbus-1-dev bridge-utils tshark python3-pycryptodome + + - name: Install pip dependencies + run: sudo pip install pycryptodome - name: Checking if we have hostap in cache uses: actions/cache/restore@v4 diff --git a/.github/workflows/ipmitool.yml b/.github/workflows/ipmitool.yml index bbcdd9028b..ec209f087b 100644 --- a/.github/workflows/ipmitool.yml +++ b/.github/workflows/ipmitool.yml @@ -51,8 +51,15 @@ jobs: runs-on: ubuntu-24.04 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 - name: Install dependencies - run: export DEBIAN_FRONTEND=noninteractive && sudo apt-get update && sudo apt-get install -y libreadline-dev + uses: ./.github/actions/install-apt-deps + with: + packages: libreadline-dev - name: Download lib uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/jwt-cpp.yml b/.github/workflows/jwt-cpp.yml index 09d1151df1..f62df31ab5 100644 --- a/.github/workflows/jwt-cpp.yml +++ b/.github/workflows/jwt-cpp.yml @@ -54,12 +54,16 @@ jobs: runs-on: ${{ matrix.config.runner }} needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install libgtest-dev + uses: ./.github/actions/install-apt-deps + with: + packages: libgtest-dev - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/linuxkm.yml b/.github/workflows/linuxkm.yml index db2798dab8..f1a30a7436 100644 --- a/.github/workflows/linuxkm.yml +++ b/.github/workflows/linuxkm.yml @@ -31,8 +31,11 @@ jobs: - name: Prepare target kernel for module builds run: | echo "updating linux-headers" - sudo apt-get update || $(exit 2) - sudo apt-get install linux-headers-$(uname -r) -y || $(exit 3) + for i in 1 2 3; do + sudo apt-get update && sudo apt-get install -y linux-headers-$(uname -r) && break + echo "::warning::apt-get failed (attempt $i/3), retrying..." + sleep $((5 * i)) + done || $(exit 2) echo "preparing target kernel $(uname -r)" pushd "/lib/modules/$(uname -r)/build" || $(exit 4) if [ -f /proc/config.gz ]; then gzip -dc /proc/config.gz > /tmp/.config && sudo mv /tmp/.config . || $(exit 5); elif [ -f "/boot/config-$(uname -r)" ]; then sudo cp -p "/boot/config-$(uname -r)" .config || $(exit 6); fi diff --git a/.github/workflows/memcached.yml b/.github/workflows/memcached.yml index 128c03d470..9771d049b0 100644 --- a/.github/workflows/memcached.yml +++ b/.github/workflows/memcached.yml @@ -65,11 +65,16 @@ jobs: repository: wolfssl/osp path: osp + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libevent-dev libevent-2.1-7 automake pkg-config make libio-socket-ssl-perl + uses: ./.github/actions/install-apt-deps + with: + packages: libevent-dev libevent-2.1-7 automake pkg-config make libio-socket-ssl-perl - name: Checkout memcached uses: actions/checkout@v4 diff --git a/.github/workflows/mono.yml b/.github/workflows/mono.yml index 5b76095d7b..ce7a5a930a 100644 --- a/.github/workflows/mono.yml +++ b/.github/workflows/mono.yml @@ -20,6 +20,12 @@ jobs: timeout-minutes: 10 steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + # Build wolfSSL using the user_settings.h from the C# wrapper directory - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -30,9 +36,9 @@ jobs: check: false - name: Install mono-complete - run: | - sudo apt-get update - sudo apt-get install -y mono-complete + uses: ./.github/actions/install-apt-deps + with: + packages: mono-complete - name: Copy wolfSSL.dll to C# wrapper directory run: | diff --git a/.github/workflows/mosquitto.yml b/.github/workflows/mosquitto.yml index 3e14debc36..84d2e06d43 100644 --- a/.github/workflows/mosquitto.yml +++ b/.github/workflows/mosquitto.yml @@ -64,11 +64,16 @@ jobs: repository: wolfssl/osp path: osp + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y build-essential libev-dev libssl-dev automake python3-docutils libcunit1 libcunit1-doc libcunit1-dev pkg-config make python3-psutil + uses: ./.github/actions/install-apt-deps + with: + packages: build-essential libev-dev libssl-dev automake python3-docutils libcunit1 libcunit1-doc libcunit1-dev pkg-config make python3-psutil - name: Checkout mosquitto uses: actions/checkout@v4 diff --git a/.github/workflows/msmtp.yml b/.github/workflows/msmtp.yml index 2b1fa7885c..f087694a25 100644 --- a/.github/workflows/msmtp.yml +++ b/.github/workflows/msmtp.yml @@ -64,12 +64,16 @@ jobs: repository: wolfssl/osp path: osp + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - autoconf automake libtool pkg-config gettext \ - libidn2-dev libsecret-1-dev autopoint + uses: ./.github/actions/install-apt-deps + with: + packages: autoconf automake libtool pkg-config gettext libidn2-dev libsecret-1-dev autopoint - name: Checkout msmtp uses: actions/checkout@v4 diff --git a/.github/workflows/multi-compiler.yml b/.github/workflows/multi-compiler.yml index 349ec385dc..273ea71453 100644 --- a/.github/workflows/multi-compiler.yml +++ b/.github/workflows/multi-compiler.yml @@ -42,9 +42,11 @@ jobs: # This should be a safe limit for the tests to run. timeout-minutes: 4 steps: - - name: Install dependencies - run: export DEBIAN_FRONTEND=noninteractive && sudo apt-get update && sudo apt-get install -y ${{ matrix.CC }} - uses: actions/checkout@v4 + - name: Install dependencies + uses: ./.github/actions/install-apt-deps + with: + packages: ${{ matrix.CC }} - name: Build env: CC: ${{ matrix.CC }} diff --git a/.github/workflows/nss.yml b/.github/workflows/nss.yml index f88f205929..f0f01315fd 100644 --- a/.github/workflows/nss.yml +++ b/.github/workflows/nss.yml @@ -25,6 +25,12 @@ jobs: # This should be a safe limit for the tests to run. timeout-minutes: 30 steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Checking if we have nss in cache uses: actions/cache@v4 id: cache @@ -35,12 +41,9 @@ jobs: - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - # hostap dependencies - sudo apt-get install -y gyp ninja-build + uses: ./.github/actions/install-apt-deps + with: + packages: gyp ninja-build - name: Checkout nss if: steps.cache.outputs.cache-hit != 'true' diff --git a/.github/workflows/openvpn.yml b/.github/workflows/openvpn.yml index 34ea287518..24e0de2785 100644 --- a/.github/workflows/openvpn.yml +++ b/.github/workflows/openvpn.yml @@ -51,6 +51,12 @@ jobs: timeout-minutes: 10 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Download lib uses: actions/download-artifact@v4 with: @@ -60,11 +66,9 @@ jobs: run: tar -xf build-dir.tgz - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev \ - linux-libc-dev man2html libcmocka-dev python3-docutils \ - libtool automake autoconf libnl-genl-3-dev libnl-genl-3-200 + uses: ./.github/actions/install-apt-deps + with: + packages: liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf libnl-genl-3-dev libnl-genl-3-200 - name: workaround high-entropy ASLR # not needed after either an update to llvm or runner is done diff --git a/.github/workflows/pam-ipmi.yml b/.github/workflows/pam-ipmi.yml index 78b162a3ce..4a69c74a52 100644 --- a/.github/workflows/pam-ipmi.yml +++ b/.github/workflows/pam-ipmi.yml @@ -51,12 +51,16 @@ jobs: runs-on: ubuntu-24.04 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install libpam-dev ninja-build meson + uses: ./.github/actions/install-apt-deps + with: + packages: libpam-dev ninja-build meson - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 4080b1528c..6a1e44a756 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -98,14 +98,16 @@ jobs: timeout-minutes: 60 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential autoconf automake autoconf-archive pkgconf \ - libffi-dev libbz2-dev libreadline-dev libsqlite3-dev \ - zlib1g-dev libncursesw5-dev libgdbm-dev libnss3-dev \ - liblzma-dev uuid-dev pkg-config + uses: ./.github/actions/install-apt-deps + with: + packages: build-essential autoconf automake autoconf-archive pkgconf libffi-dev libbz2-dev libreadline-dev libsqlite3-dev zlib1g-dev libncursesw5-dev libgdbm-dev libnss3-dev liblzma-dev uuid-dev pkg-config - name: Download wolfSSL uses: actions/download-artifact@v4 diff --git a/.github/workflows/renode-stm32h753.yml b/.github/workflows/renode-stm32h753.yml index 9a56d39cf2..fc3c3fdb10 100644 --- a/.github/workflows/renode-stm32h753.yml +++ b/.github/workflows/renode-stm32h753.yml @@ -37,20 +37,10 @@ jobs: uses: actions/checkout@v4 - name: Set up build environment - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - ninja-build \ - python3 \ - git \ - gcc-arm-none-eabi \ - libnewlib-arm-none-eabi \ - libstdc++-arm-none-eabi-newlib \ - wget \ - unzip + uses: ./.github/actions/install-apt-deps + with: + packages: build-essential ca-certificates cmake ninja-build python3 git gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib wget unzip + no-install-recommends: 'true' - name: Cache CMSIS Device id: cache-cmsis-device @@ -89,13 +79,11 @@ jobs: renode-1.15.3- - name: Install Renode dependencies - run: | - # Install Mono and other dependencies needed for Renode (always needed, even when cached) - sudo apt-get install -y --no-install-recommends \ - mono-runtime \ - libmono-cil-dev \ - screen \ - policykit-1 || true + uses: ./.github/actions/install-apt-deps + with: + packages: mono-runtime libmono-cil-dev screen policykit-1 + no-install-recommends: 'true' + continue-on-error: true - name: Install Renode (if not cached) if: steps.cache-renode.outputs.cache-hit != 'true' diff --git a/.github/workflows/rng-tools.yml b/.github/workflows/rng-tools.yml index dc26de62e1..1cf43d5ebd 100644 --- a/.github/workflows/rng-tools.yml +++ b/.github/workflows/rng-tools.yml @@ -52,12 +52,16 @@ jobs: timeout-minutes: 4 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libcurl4-openssl-dev libjansson-dev libp11-dev librtlsdr-dev libcap-dev + uses: ./.github/actions/install-apt-deps + with: + packages: libcurl4-openssl-dev libjansson-dev libp11-dev librtlsdr-dev libcap-dev - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/socat.yml b/.github/workflows/socat.yml index 89e4fcc788..3c55e95457 100644 --- a/.github/workflows/socat.yml +++ b/.github/workflows/socat.yml @@ -52,9 +52,16 @@ jobs: - socat_version: "1.8.0.3" expect_fail: "146,386,399,402,459,460,467,468,475,478,491,492,495,528" steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install prereqs - run: - sudo apt-get install build-essential autoconf libtool pkg-config clang libc++-dev + uses: ./.github/actions/install-apt-deps + with: + packages: build-essential autoconf libtool pkg-config clang libc++-dev - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/softhsm.yml b/.github/workflows/softhsm.yml index ea9b3e5aa4..149c6f62ac 100644 --- a/.github/workflows/softhsm.yml +++ b/.github/workflows/softhsm.yml @@ -52,12 +52,16 @@ jobs: timeout-minutes: 20 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libcppunit-dev + uses: ./.github/actions/install-apt-deps + with: + packages: libcppunit-dev - name: Download lib uses: actions/download-artifact@v4 diff --git a/.github/workflows/sssd.yml b/.github/workflows/sssd.yml index 797a1f4fbf..9998bc9baa 100644 --- a/.github/workflows/sssd.yml +++ b/.github/workflows/sssd.yml @@ -56,13 +56,17 @@ jobs: timeout-minutes: 20 needs: build_wolfssl steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y build-essential autoconf libldb-dev \ - libldb2 python3-ldb bc libcap-dev + uses: ./.github/actions/install-apt-deps + with: + packages: build-essential autoconf libldb-dev libldb2 python3-ldb bc libcap-dev + cache: 'false' - name: Setup env run: | diff --git a/.github/workflows/tls-anvil.yml b/.github/workflows/tls-anvil.yml index 3cd1f8f3bc..158c9eec32 100644 --- a/.github/workflows/tls-anvil.yml +++ b/.github/workflows/tls-anvil.yml @@ -43,10 +43,9 @@ jobs: uses: actions/checkout@v4 - name: Install dependencies - run: | - sudo apt-get update -q - sudo apt-get install -y build-essential autoconf automake libtool jq psmisc || \ - sudo apt-get install -y build-essential autoconf automake libtool jq + uses: ./.github/actions/install-apt-deps + with: + packages: build-essential autoconf automake libtool jq psmisc - name: Pull TLS-Anvil Docker image run: docker pull ghcr.io/tls-attacker/tlsanvil:latest diff --git a/.github/workflows/wolfCrypt-Wconversion.yml b/.github/workflows/wolfCrypt-Wconversion.yml index 22f787b8d4..cc4870eaca 100644 --- a/.github/workflows/wolfCrypt-Wconversion.yml +++ b/.github/workflows/wolfCrypt-Wconversion.yml @@ -39,11 +39,10 @@ jobs: - uses: actions/checkout@v4 name: Checkout wolfSSL - - name: install_multilib - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y gcc-multilib + - name: Install multilib + uses: ./.github/actions/install-apt-deps + with: + packages: gcc-multilib - name: Build wolfCrypt with extra type conversion warnings run: | diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index 922dce92c6..12d189d066 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -30,24 +30,16 @@ jobs: # This should be a safe limit for the tests to run. timeout-minutes: 45 steps: + - name: Checkout wolfSSL CI actions + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions + depth: 1 + - name: Install dependencies - run: | - # Don't prompt for anything - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - # most of the ci-base zephyr docker image packages - sudo apt-get install -y zip bridge-utils uml-utilities \ - git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget \ - python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \ - make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \ - autoconf automake bison build-essential ca-certificates cargo ccache chrpath cmake \ - cpio device-tree-compiler dfu-util diffstat dos2unix doxygen file flex g++ gawk gcc \ - gcovr git git-core gnupg gperf gtk-sharp3 help2man iproute2 lcov libcairo2-dev \ - libglib2.0-dev libgtk2.0-0 liblocale-gettext-perl libncurses5-dev libpcap-dev \ - libpopt0 libsdl1.2-dev libsdl2-dev libssl-dev libtool libtool-bin locales make \ - net-tools ninja-build openssh-client parallel pkg-config python3-dev python3-pip \ - python3-ply python3-setuptools python-is-python3 qemu-kvm rsync socat srecord sudo \ - texinfo unzip wget ovmf xz-utils + uses: ./.github/actions/install-apt-deps + with: + packages: zip bridge-utils uml-utilities git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 autoconf automake bison build-essential ca-certificates cargo ccache chrpath cmake cpio device-tree-compiler dfu-util diffstat dos2unix doxygen file flex g++ gawk gcc gcovr git git-core gnupg gperf gtk-sharp3 help2man iproute2 lcov libcairo2-dev libglib2.0-dev libgtk2.0-0 liblocale-gettext-perl libncurses5-dev libpcap-dev libpopt0 libsdl1.2-dev libsdl2-dev libssl-dev libtool libtool-bin locales make net-tools ninja-build openssh-client parallel pkg-config python3-dev python3-pip python3-ply python3-setuptools python-is-python3 qemu-kvm rsync socat srecord sudo texinfo unzip wget ovmf xz-utils - name: Setup cmake version uses: jwlawson/actions-setup-cmake@v2