]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CI: Cache hostapd build directory to avoid unnecessary rebuild (#3989)
authorTerry Burton <tez@terryburton.co.uk>
Tue, 16 Mar 2021 17:58:38 +0000 (17:58 +0000)
committerGitHub <noreply@github.com>
Tue, 16 Mar 2021 17:58:38 +0000 (17:58 +0000)
.github/workflows/ci.yml
scripts/ci/eapol_test-build.sh

index 1fd1e85e05bd621bd2ba5e8b2f4e0631f986c6cc..28ca6d681ef7d34ce0feb85f53b1a43f72d39c4d 100644 (file)
@@ -16,6 +16,8 @@ env:
   FR_GLOBAL_POOL: 4M
   TEST_CERTS: yes
   DO_BUILD: yes
+  HOSTAPD_BUILD_DIR: /tmp/hostapd.ci
+  HOSTAPD_GIT_TAG: hostap_2_8
   CI: 1
   GH_ACTIONS: 1
 
@@ -101,6 +103,14 @@ jobs:
     - name: Git LFS pull
       run: git lfs pull
 
+    - name: Restore eapol_test build directory from cache
+      uses: actions/cache@v2
+      id: hostapd-cache
+      with:
+        path: ${{ env.HOSTAPD_BUILD_DIR }}
+        key: hostapd-${{ runner.os }}-${{ env.HOSTAPD_GIT_TAG }}-v3
+      if: ${{ matrix.env.TEST_TYPE != 'fuzzing' }}
+
     - name: Package manager performance improvements
       if: ${{ runner.os != 'macOS' }}
       run: |
index f10ef43b386d8a21c0260fdeb19316302619f082..03f756375332647b2f93927d45e6fe4df3124d58 100755 (executable)
@@ -31,6 +31,7 @@
 #  FORCE_BUILD=1 in the environment.
 #
 
+: ${BUILD_DIR:="${HOSTAPD_BUILD_DIR}"}
 TMP_BUILD_DIR="${BUILD_DIR}"
 : ${TMP_BUILD_DIR:="$(mktemp -d -t eapol_test.XXXXX)"}
 : ${HOSTAPD_DIR:="${TMP_BUILD_DIR}/hostapd"}
@@ -88,7 +89,7 @@ if ! [ -e "${HOSTAPD_DIR}/.git" ] && ! git clone --branch "${HOSTAPD_GIT_TAG}" -
     exit 1
 fi
 
-cp "$BUILD_CONF_FILE" "$WPA_SUPPLICANT_DIR/.config"
+cp -n "$BUILD_CONF_FILE" "$WPA_SUPPLICANT_DIR/.config"
 
 if ! ${MAKE} -C "${WPA_SUPPLICANT_DIR}" -j8 eapol_test 1>&2 || [ ! -e "${WPA_SUPPLICANT_DIR}/eapol_test" ]; then
     echo "Build error" 1>&2