From cb53fe1a3588d95fb7f92a17b1af9185cf4e89fc Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 16 Oct 2024 11:27:43 +0200 Subject: [PATCH] wip Signed-off-by: Federico Di Pierro --- .github/workflows/latest-kernel.yml | 63 +++++++++++++++++++---------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/.github/workflows/latest-kernel.yml b/.github/workflows/latest-kernel.yml index 4252b0da59..d8f8528204 100644 --- a/.github/workflows/latest-kernel.yml +++ b/.github/workflows/latest-kernel.yml @@ -11,34 +11,23 @@ on: - cron: '0 8 * * *' # every day at 8am jobs: - build-latest-kernel: - name: build-latest-kernel-${{ matrix.arch }} + compute-latest-version: outputs: - build_amd64: ${{ steps.build-amd64.outcome }} - build_arm64: ${{ steps.build-arm64.outcome }} - latest_vers: ${{ steps.latest-version-amd64.latest_vers }} - runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }} - strategy: - fail-fast: false - matrix: - arch: [amd64, arm64] - container: - image: falcosecurity/driverkit:latest + latest_vers: ${{ steps.latest-version.latest_vers }} + runs-on: 'ubuntu-latest' steps: - name: Checkout Archlinux mainline package ⤵️ run: | - apk update && apk add git git clone https://aur.archlinux.org/linux-mainline.git linux/ - name: Generate driverkit config - id: latest-version-${{ matrix.arch }} + id: latest-version # Note: in case we are building latest mainline, # we grep the linux-mainline aur PKGBUILD "_tag" line, that is made like: "_tag=v6.4-rc1" # We then need to extract the part after the "=" and finally remove the starting "v". run: | cd linux/ echo "kernelversion: 1" > dk.yaml - echo "architecture: ${{ matrix.arch }}" >> dk.yaml echo "driverversion: ${{ github.sha }}" >> dk.yaml echo "output:" >> dk.yaml echo " module: mod.ko" >> dk.yaml @@ -60,16 +49,48 @@ jobs: name: driverkit_config.yaml path: linux/dk.yaml + build-latest-kernel-amd64: + needs: 'compute-latest-version' + outputs: + build: ${{ steps.build.outcome }} + runs-on: 'ubuntu-22.04' + container: + image: falcosecurity/driverkit:latest + steps: + - name: Download driverkit config + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: driverkit_config.yaml + + - name: Test drivers build + id: build + run: | + echo "Testing build of drivers against: ${{ needs.compute-latest-version.latest_vers }}" + driverkit docker -c driverkit_config.yaml -l debug + + build-latest-kernel-arm64: + needs: 'compute-latest-version' + outputs: + build: ${{ steps.build.outcome }} + runs-on: 'actuated-arm64-8cpu-16gb' + container: + image: falcosecurity/driverkit:latest + steps: + - name: Download driverkit config + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: driverkit_config.yaml + - name: Test drivers build - id: build-${{ matrix.arch }} + id: build run: | - echo "Testing build of drivers against: ${{ steps.latest-version.outputs.latest_vers }}" - driverkit docker -c linux/dk.yaml -l debug + echo "Testing build of drivers against: ${{ needs.compute-latest-version.latest_vers }}" + driverkit docker -c driverkit_config.yaml -l debug badge-latest-kernel: if: always() && github.event_name == 'schedule' runs-on: 'ubuntu-latest' - needs: 'build-latest-kernel' + needs: [compute-latest-version,build-latest-kernel-amd64,build-latest-kernel-arm64] steps: - name: Update README badge uses: schneegans/dynamic-badges-action@e9a478b16159b4d31420099ba146cdc50f134483 # v1.7.0 @@ -78,5 +99,5 @@ jobs: gistID: 1cbc5d42edf8e3a02fb75e76625f1072 filename: kernel.json label: Drivers build - message: ${{ needs.build-latest-kernel.latest_vers }} - color: ${{ (needs.build-latest-kernel.build_amd64 != 'success' || needs.build-latest-kernel.build_arm64 != 'success') && 'red' || 'brightgreen' }} + message: ${{ needs.compute-latest-version.latest_vers }} + color: ${{ (needs.build-latest-kernel-amd64.build != 'success' || needs.build-latest-kernel-arm64.build != 'success') && 'red' || 'brightgreen' }}