From f2bfa1b93288b636278ca0fef71b49a24ea04c7f Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Wed, 13 May 2026 11:26:33 +0000 Subject: [PATCH] ci: switch direct apt usage to install-apt-deps action multi-arch.yml and linuxkm.yml were installing apt packages with inline shell commands. Replace them with the install-apt-deps composite action for consistent retry behavior and caching. --- .github/workflows/linuxkm.yml | 16 +++++----------- .github/workflows/multi-arch.yml | 8 ++++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linuxkm.yml b/.github/workflows/linuxkm.yml index 8c3cd7c53a5..347c4b733d1 100644 --- a/.github/workflows/linuxkm.yml +++ b/.github/workflows/linuxkm.yml @@ -28,19 +28,13 @@ jobs: - uses: actions/checkout@v4 name: Checkout wolfSSL + - name: Install linux-headers + uses: ./.github/actions/install-apt-deps + with: + packages: linux-headers-$(uname -r) + - name: Prepare target kernel for module builds run: | - echo "updating linux-headers" - apt_ok=false - for i in 1 2 3; do - if sudo apt-get update && sudo apt-get install -y linux-headers-$(uname -r); then - apt_ok=true - break - fi - echo "::warning::apt-get failed (attempt $i/3), retrying..." - sleep $((5 * i)) - done - if [ "$apt_ok" != true ]; then exit 2; fi 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/multi-arch.yml b/.github/workflows/multi-arch.yml index 1ee3c0baf52..aac372c464e 100644 --- a/.github/workflows/multi-arch.yml +++ b/.github/workflows/multi-arch.yml @@ -56,11 +56,11 @@ jobs: # This should be a safe limit for the tests to run. timeout-minutes: 10 steps: - - name: Install Compiler - run: | - sudo apt update - sudo apt install -y crossbuild-essential-${{ matrix.ARCH }} qemu-user - uses: actions/checkout@v4 + - name: Install Compiler + uses: ./.github/actions/install-apt-deps + with: + packages: crossbuild-essential-${{ matrix.ARCH }} qemu-user - name: Build for ${{ matrix.ARCH }} with ${{ matrix.opts.name }} env: CC: ${{ matrix.CC }}