]> git.ozlabs.org Git - ppp.git/blobdiff - .github/workflows/buildroot.yaml
pppd.8: Document netmask option
[ppp.git] / .github / workflows / buildroot.yaml
index a4fadbc1cd3656689dea03044fa3128ae745726d..4353069757e4065fdf333032eac14bc7d0d7b623 100644 (file)
@@ -1,56 +1,43 @@
 name: Buildroot
-on: [push]
+on: [push, pull_request]
 
 jobs:
   buildroot:
+    name: Buildroot
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        defconfig_name: [qemu_x86_defconfig, qemu_x86_64_defconfig, raspberrypi4_defconfig, raspberrypi4_64_defconfig, qemu_ppc64le_pseries_defconfig, qemu_mips32r2_malta_defconfig, qemu_mips64_malta_defconfig]
-        libc_name: [glibc, uclibc, musl]
+        defconfig_name:
+          - qemu_x86_defconfig
+          - qemu_x86_64_defconfig
+          - raspberrypi4_defconfig
+          - raspberrypi4_64_defconfig
+          - qemu_ppc64le_pseries_defconfig
+          - qemu_mips32r2_malta_defconfig
+          - qemu_mips64_malta_defconfig
+          - qemu_riscv32_virt_defconfig
+          - qemu_riscv64_virt_defconfig
+        libc_name:
+          - glibc
+          - uclibc
+          - musl
+    env:
+      CI_VERSION: v1.1
+      BUILDROOT_DIRECTORY_NAME: buildroot-${{ matrix.defconfig_name }}-${{ matrix.libc_name }}
     steps:
-      - name: Checkout Buildroot sources
-        run: git clone --depth=1 --branch=2020.11.1 https://git.busybox.net/buildroot
-      - name: Select latest PPP version
-        working-directory: buildroot/package/pppd
+      - name: Retrieve the prebuilt Buildroot image
+        working-directory: /home/runner
         run: |
-          # Allow package to build when musl libc is selected
-          sed -i '/depends on !BR2_TOOLCHAIN_USES_MUSL/d' Config.in
-          # Upstream version always needs OpenSSL
-          sed -i '/select BR2_PACKAGE_OPENSSL/c\\select BR2_PACKAGE_OPENSSL' Config.in
-          # Do not check for package hash, so there is no need to compute it
-          rm pppd.hash
-          # Buildroot patch is already applied upstream
-          rm -f 0001-pppd-Fix-bounds-check.patch
-          # Get package sources from head of master branch
-          sed -i "/PPPD_VERSION =/c\\PPPD_VERSION = ${GITHUB_SHA}" pppd.mk
-          sed -i '/PPPD_SITE =/c\\PPPD_SITE = https://github.com/paulusmack/ppp' pppd.mk
-          sed -i '9iPPPD_SITE_METHOD = git' pppd.mk
-          # Plugin rp-pppoe has been renamed in "pppoe"
-          sed -i 's/rp-pppoe/pppoe/g' pppd.mk
-      - name: Enable PPP build
-        working-directory: buildroot
+          wget https://github.com/ppp-project/ppp-ci/releases/download/${{ env.CI_VERSION }}/${{ env.BUILDROOT_DIRECTORY_NAME }}.tar.zst
+          tar --zstd --strip-components=2 -xf ${{ env.BUILDROOT_DIRECTORY_NAME }}.tar.zst
+      - name: Select the latest PPP upstream version
+        working-directory: /home/runner/${{ env.BUILDROOT_DIRECTORY_NAME }}/package/pppd
         run: |
-          # Enable all Buildroot PPP options as everything is built by upstream build system
-          echo "BR2_PACKAGE_PPPD=y" >> configs/${{ matrix.defconfig_name }}
-          echo "BR2_PACKAGE_PPPD_FILTER=y" >> configs/${{ matrix.defconfig_name }}
-          echo "BR2_PACKAGE_PPPD_RADIUS=y" >> configs/${{ matrix.defconfig_name }}
-          echo "BR2_PACKAGE_PPPD_OVERWRITE_RESOLV_CONF=y" >> configs/${{ matrix.defconfig_name }}
-      - name: Select glibc
-        if: ${{ matrix.libc_name == 'glibc' }}
-        working-directory: buildroot
-        run: echo "BR2_TOOLCHAIN_BUILDROOT_GLIBC=y" >> configs/${{ matrix.defconfig_name }}
-      - name: Select uClibc
-        if: ${{ matrix.libc_name == 'uclibc' }}
-        working-directory: buildroot
-        run: echo "BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y" >> configs/${{ matrix.defconfig_name }}
-      - name: Select musl
-        if: ${{ matrix.libc_name == 'musl' }}
-        working-directory: buildroot
-        run: echo "BR2_TOOLCHAIN_BUILDROOT_MUSL=y" >> configs/${{ matrix.defconfig_name }}
-      - name: Configure Buildroot
-        working-directory: buildroot
-        run: make ${{ matrix.defconfig_name }}
+          # Get package sources from head of current branch
+          sed -i "/PPPD_VERSION =/c\\PPPD_VERSION = ${GITHUB_SHA}" pppd.mk
+      - name: Trigger a PPP package rebuild
+        working-directory: /home/runner/${{ env.BUILDROOT_DIRECTORY_NAME }}/output/build
+        run: rm -rf pppd*
       - name: Build
-        working-directory: buildroot
+        working-directory: /home/runner/${{ env.BUILDROOT_DIRECTORY_NAME }}
         run: make