blob: 408d25ea29af27bbe631af20dded7361e6395815 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001# SPDX-FileCopyrightText: Andrei Gherzan <andrei.gherzan@huawei.com>
2#
3# SPDX-License-Identifier: MIT
4
Patrick Williamsdb4c27e2022-08-05 08:10:29 -05005---
6
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00007name: Builds
8
9on:
10 pull_request:
11
12jobs:
13 build:
14 strategy:
15 fail-fast: true
16 matrix:
17 machine:
18 - raspberrypi
19 - raspberrypi0-2w-64
20 - raspberrypi0-2w
21 - raspberrypi0
22 - raspberrypi0-wifi
23 - raspberrypi2
24 - raspberrypi3-64
25 - raspberrypi3
26 - raspberrypi4-64
27 - raspberrypi4
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060028 - raspberrypi5
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000029 - raspberrypi-cm3
30 - raspberrypi-cm
Andrew Geissler87f5cff2022-09-30 13:13:31 -050031 - raspberrypi-armv7
32 - raspberrypi-armv8
Patrick Williams03907ee2022-05-01 06:28:52 -050033 image: [rpi-test-image]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000034 distro: [poky]
35 runs-on: [self-hosted, Linux]
36 name: ${{ matrix.machine }}/${{ matrix.image }}/poky/systemd
37 env:
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050038 DL_DIR: /var/lib/ci/yocto/downloads
39 SSTATE_DIR: /var/lib/ci/yocto/sstate
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000040 steps:
41 - name: Checkout the code
Patrick Williams7784c422022-11-17 07:29:11 -060042 uses: actions/checkout@v3
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000043 with:
44 fetch-depth: 0
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050045 - name: Define Yocto build files
46 id: changed-files-specific
47 uses: tj-actions/changed-files@v24
48 with:
49 files: |
50 .github/actions/**
51 .github/workflows/docker-images/yocto-builder/**
52 .github/workflows/docker-images/*.sh
53 .github/workflows/yocto-builds.yml
Patrick Williams2194f502022-10-16 14:26:09 -050054 classes/**
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050055 conf/**
56 dynamic-layers/**
57 files/**
58 lib/**
59 recipes-**
60 wic/**
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000061 - name: Build a temporary yocto-builder image
62 uses: ./.github/actions/docker-build
63 with:
64 docker_image: yocto-builder
65 id: ${{ github.event.number }}
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050066 if: steps.changed-files-specific.outputs.any_changed == 'true'
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000067 - name: Build the image
68 run: |
69 docker run --rm \
70 -v "$GITHUB_WORKSPACE:/work:ro" \
71 -v "$DL_DIR:$DL_DIR:rw" \
72 -v "$SSTATE_DIR:$SSTATE_DIR:rw" \
73 --env "BASE_REF=$GITHUB_BASE_REF" \
74 --env "MACHINE=${{ matrix.machine }}" \
75 --env "DISTRO=${{ matrix.distro }}" \
76 --env "IMAGE=${{ matrix.image }}" \
77 --env "DL_DIR=$DL_DIR" \
78 --env "SSTATE_DIR=$SSTATE_DIR" \
79 "yocto-builder-${{ github.event.number }}" \
80 /entrypoint-build.sh
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050081 if: steps.changed-files-specific.outputs.any_changed == 'true'
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000082 - name: Cleanup temporary docker image
83 uses: ./.github/actions/docker-clean-image
84 with:
85 docker_image: yocto-builder-${{ github.event.number }}
86 if: always()
87 - name: Cleanup dangling docker images
88 uses: ./.github/actions/docker-clean-dangling
89 if: always()