Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: Andrei Gherzan <andrei.gherzan@huawei.com> |
| 2 | # |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 5 | --- |
| 6 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 7 | name: Builds |
| 8 | |
| 9 | on: |
| 10 | pull_request: |
| 11 | |
| 12 | jobs: |
| 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 Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame] | 28 | - raspberrypi5 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 29 | - raspberrypi-cm3 |
| 30 | - raspberrypi-cm |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 31 | - raspberrypi-armv7 |
| 32 | - raspberrypi-armv8 |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 33 | image: [rpi-test-image] |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 34 | distro: [poky] |
| 35 | runs-on: [self-hosted, Linux] |
| 36 | name: ${{ matrix.machine }}/${{ matrix.image }}/poky/systemd |
| 37 | env: |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 38 | DL_DIR: /var/lib/ci/yocto/downloads |
| 39 | SSTATE_DIR: /var/lib/ci/yocto/sstate |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 40 | steps: |
| 41 | - name: Checkout the code |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 42 | uses: actions/checkout@v3 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 43 | with: |
| 44 | fetch-depth: 0 |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 45 | - 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 Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 54 | classes/** |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 55 | conf/** |
| 56 | dynamic-layers/** |
| 57 | files/** |
| 58 | lib/** |
| 59 | recipes-** |
| 60 | wic/** |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 61 | - 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 Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 66 | if: steps.changed-files-specific.outputs.any_changed == 'true' |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 67 | - 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 Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 81 | if: steps.changed-files-specific.outputs.any_changed == 'true' |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 82 | - 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() |