blob: d237f0ab39f0a699e3384c5f37c0c2597dd62e10 [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
28 - raspberrypi-cm3
29 - raspberrypi-cm
Andrew Geissler87f5cff2022-09-30 13:13:31 -050030 - raspberrypi-armv7
31 - raspberrypi-armv8
Patrick Williams03907ee2022-05-01 06:28:52 -050032 image: [rpi-test-image]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000033 distro: [poky]
34 runs-on: [self-hosted, Linux]
35 name: ${{ matrix.machine }}/${{ matrix.image }}/poky/systemd
36 env:
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050037 DL_DIR: /var/lib/ci/yocto/downloads
38 SSTATE_DIR: /var/lib/ci/yocto/sstate
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000039 steps:
40 - name: Checkout the code
41 uses: actions/checkout@v2
42 with:
43 fetch-depth: 0
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050044 - name: Define Yocto build files
45 id: changed-files-specific
46 uses: tj-actions/changed-files@v24
47 with:
48 files: |
49 .github/actions/**
50 .github/workflows/docker-images/yocto-builder/**
51 .github/workflows/docker-images/*.sh
52 .github/workflows/yocto-builds.yml
Patrick Williams2194f502022-10-16 14:26:09 -050053 classes/**
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050054 conf/**
55 dynamic-layers/**
56 files/**
57 lib/**
58 recipes-**
59 wic/**
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000060 - name: Build a temporary yocto-builder image
61 uses: ./.github/actions/docker-build
62 with:
63 docker_image: yocto-builder
64 id: ${{ github.event.number }}
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050065 if: steps.changed-files-specific.outputs.any_changed == 'true'
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000066 - name: Build the image
67 run: |
68 docker run --rm \
69 -v "$GITHUB_WORKSPACE:/work:ro" \
70 -v "$DL_DIR:$DL_DIR:rw" \
71 -v "$SSTATE_DIR:$SSTATE_DIR:rw" \
72 --env "BASE_REF=$GITHUB_BASE_REF" \
73 --env "MACHINE=${{ matrix.machine }}" \
74 --env "DISTRO=${{ matrix.distro }}" \
75 --env "IMAGE=${{ matrix.image }}" \
76 --env "DL_DIR=$DL_DIR" \
77 --env "SSTATE_DIR=$SSTATE_DIR" \
78 "yocto-builder-${{ github.event.number }}" \
79 /entrypoint-build.sh
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050080 if: steps.changed-files-specific.outputs.any_changed == 'true'
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000081 - name: Cleanup temporary docker image
82 uses: ./.github/actions/docker-clean-image
83 with:
84 docker_image: yocto-builder-${{ github.event.number }}
85 if: always()
86 - name: Cleanup dangling docker images
87 uses: ./.github/actions/docker-clean-dangling
88 if: always()