blob: fa11815f1ec11e421d77b5b3d4b6083b24df4be0 [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: Yocto Compatible
8
9on:
10 pull_request:
11
12jobs:
13 yocto-check-layer:
14 name: Validate with yocto-check-layer
15 runs-on: [self-hosted, Linux]
16 steps:
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050017 - name: Checkout the code
Patrick Williams7784c422022-11-17 07:29:11 -060018 uses: actions/checkout@v3
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050019 with:
20 fetch-depth: 0
21 - name: Define Yocto build files
22 id: changed-files-specific
23 uses: tj-actions/changed-files@v24
24 with:
25 files: |
26 .github/actions/**
27 .github/workflows/docker-images/yocto-builder/**
28 .github/workflows/docker-images/*.sh
29 .github/workflows/yocto-builds.yml
Patrick Williams2194f502022-10-16 14:26:09 -050030 classes/**
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050031 conf/**
32 dynamic-layers/**
33 files/**
34 lib/**
35 recipes-**
36 wic/**
37 - name: Build a temporary yocto-builder image
38 uses: ./.github/actions/docker-build
39 with:
40 docker_image: yocto-builder
41 id: ${{ github.event.number }}
42 if: steps.changed-files-specific.outputs.any_changed == 'true'
43 - name: Run yocto-check-layer
44 run: |
45 docker run --rm -v "$GITHUB_WORKSPACE:/work:ro" \
46 --env "BASE_REF=$GITHUB_BASE_REF" \
47 "yocto-builder-${{ github.event.number }}" \
48 /entrypoint-yocto-check-layer.sh
49 if: steps.changed-files-specific.outputs.any_changed == 'true'
50 - name: Cleanup temporary docker image
51 uses: ./.github/actions/docker-clean-image
52 with:
53 docker_image: yocto-builder-${{ github.event.number }}
54 if: always()
55 - name: Cleanup dangling docker images
56 uses: ./.github/actions/docker-clean-dangling
57 if: always()