blob: 824745cc5ef3139d91ae18fb9d39ac78e3255773 [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
Patrick Williams03907ee2022-05-01 06:28:52 -050030 image: [rpi-test-image]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000031 distro: [poky]
32 runs-on: [self-hosted, Linux]
33 name: ${{ matrix.machine }}/${{ matrix.image }}/poky/systemd
34 env:
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050035 DL_DIR: /var/lib/ci/yocto/downloads
36 SSTATE_DIR: /var/lib/ci/yocto/sstate
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000037 steps:
38 - name: Checkout the code
39 uses: actions/checkout@v2
40 with:
41 fetch-depth: 0
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050042 - name: Define Yocto build files
43 id: changed-files-specific
44 uses: tj-actions/changed-files@v24
45 with:
46 files: |
47 .github/actions/**
48 .github/workflows/docker-images/yocto-builder/**
49 .github/workflows/docker-images/*.sh
50 .github/workflows/yocto-builds.yml
51 classes/**'
52 conf/**
53 dynamic-layers/**
54 files/**
55 lib/**
56 recipes-**
57 wic/**
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000058 - name: Build a temporary yocto-builder image
59 uses: ./.github/actions/docker-build
60 with:
61 docker_image: yocto-builder
62 id: ${{ github.event.number }}
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050063 if: steps.changed-files-specific.outputs.any_changed == 'true'
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000064 - name: Build the image
65 run: |
66 docker run --rm \
67 -v "$GITHUB_WORKSPACE:/work:ro" \
68 -v "$DL_DIR:$DL_DIR:rw" \
69 -v "$SSTATE_DIR:$SSTATE_DIR:rw" \
70 --env "BASE_REF=$GITHUB_BASE_REF" \
71 --env "MACHINE=${{ matrix.machine }}" \
72 --env "DISTRO=${{ matrix.distro }}" \
73 --env "IMAGE=${{ matrix.image }}" \
74 --env "DL_DIR=$DL_DIR" \
75 --env "SSTATE_DIR=$SSTATE_DIR" \
76 "yocto-builder-${{ github.event.number }}" \
77 /entrypoint-build.sh
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050078 if: steps.changed-files-specific.outputs.any_changed == 'true'
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000079 - name: Cleanup temporary docker image
80 uses: ./.github/actions/docker-clean-image
81 with:
82 docker_image: yocto-builder-${{ github.event.number }}
83 if: always()
84 - name: Cleanup dangling docker images
85 uses: ./.github/actions/docker-clean-dangling
86 if: always()