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 |
| 28 | - raspberrypi-cm3 |
| 29 | - raspberrypi-cm |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 30 | - raspberrypi-armv7 |
| 31 | - raspberrypi-armv8 |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 32 | image: [rpi-test-image] |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 33 | distro: [poky] |
| 34 | runs-on: [self-hosted, Linux] |
| 35 | name: ${{ matrix.machine }}/${{ matrix.image }}/poky/systemd |
| 36 | env: |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 37 | DL_DIR: /var/lib/ci/yocto/downloads |
| 38 | SSTATE_DIR: /var/lib/ci/yocto/sstate |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 39 | steps: |
| 40 | - name: Checkout the code |
| 41 | uses: actions/checkout@v2 |
| 42 | with: |
| 43 | fetch-depth: 0 |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 44 | - 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 Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 53 | classes/** |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 54 | conf/** |
| 55 | dynamic-layers/** |
| 56 | files/** |
| 57 | lib/** |
| 58 | recipes-** |
| 59 | wic/** |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 60 | - 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 Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 65 | if: steps.changed-files-specific.outputs.any_changed == 'true' |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 66 | - 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 Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 80 | if: steps.changed-files-specific.outputs.any_changed == 'true' |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 81 | - 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() |