diff mbox series

[meta-raspberrypi,3/4] ci: Add jobs for multiconfig builds

Message ID 20220907213959.1115886-3-andrei@gherzan.com
State New
Headers show
Series [meta-raspberrypi,1/4] machine: Define firmware packages from separate variables | expand

Commit Message

Andrei Gherzan Sept. 7, 2022, 9:39 p.m. UTC
From: Andrei Gherzan <andrei.gherzan@huawei.com>

This also fixes a small typo in the normal build matrix.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
 .github/workflows/yocto-builds.yml | 68 +++++++++++++++++++++++++++++-
 1 file changed, 67 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/.github/workflows/yocto-builds.yml b/.github/workflows/yocto-builds.yml
index 824745c..0f2dcf5 100644
--- a/.github/workflows/yocto-builds.yml
+++ b/.github/workflows/yocto-builds.yml
@@ -48,7 +48,7 @@  jobs:
             .github/workflows/docker-images/yocto-builder/**
             .github/workflows/docker-images/*.sh
             .github/workflows/yocto-builds.yml
-            classes/**'
+            classes/**
             conf/**
             dynamic-layers/**
             files/**
@@ -84,3 +84,69 @@  jobs:
       - name: Cleanup dangling docker images
         uses: ./.github/actions/docker-clean-dangling
         if: always()
+
+  build-multiconfig:
+    strategy:
+      fail-fast: true
+      matrix:
+        machine:
+          - raspberrypi4
+        image: ['mc:raspberrypi:rpi-test-image']
+        distro: [poky]
+    runs-on: [self-hosted, Linux]
+    name: ${{ matrix.machine }}/${{ matrix.image }}/poky/systemd
+    env:
+      DL_DIR: /var/lib/ci/yocto/downloads
+      SSTATE_DIR: /var/lib/ci/yocto/sstate
+    steps:
+      - name: Checkout the code
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+      - name: Define Yocto build files
+        id: changed-files-specific
+        uses: tj-actions/changed-files@v24
+        with:
+          files: |
+            .github/actions/**
+            .github/workflows/docker-images/yocto-builder/**
+            .github/workflows/docker-images/*.sh
+            .github/workflows/yocto-builds.yml
+            classes/**
+            conf/**
+            dynamic-layers/**
+            files/**
+            lib/**
+            recipes-**
+            wic/**
+      - name: Build a temporary yocto-builder image
+        uses: ./.github/actions/docker-build
+        with:
+          docker_image: yocto-builder
+          id: ${{ github.event.number }}
+        if: steps.changed-files-specific.outputs.any_changed == 'true'
+      - name: Build the image
+        run: |
+          docker run --rm \
+            -v "$GITHUB_WORKSPACE:/work:ro" \
+            -v "$DL_DIR:$DL_DIR:rw" \
+            -v "$SSTATE_DIR:$SSTATE_DIR:rw" \
+            --env "BASE_REF=$GITHUB_BASE_REF" \
+            --env "MACHINE=${{ matrix.machine }}" \
+            --env "DISTRO=${{ matrix.distro }}" \
+            --env "IMAGE=${{ matrix.image }}" \
+            --env "DL_DIR=$DL_DIR" \
+            --env "SSTATE_DIR=$SSTATE_DIR" \
+            --env "BBMULTICONFIG=raspberrypi\ raspberrypi3" \
+            --env "BB_ENV_PASSTHROUGH_ADDITIONS=BBMULTICONFIG" \
+            "yocto-builder-${{ github.event.number }}" \
+            /entrypoint-build.sh
+        if: steps.changed-files-specific.outputs.any_changed == 'true'
+      - name: Cleanup temporary docker image
+        uses: ./.github/actions/docker-clean-image
+        with:
+          docker_image: yocto-builder-${{ github.event.number }}
+        if: always()
+      - name: Cleanup dangling docker images
+        uses: ./.github/actions/docker-clean-dangling
+        if: always()