blob: 6d923665c03baedaa67bc8457875523c2f799022 [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
18 uses: actions/checkout@v2
19 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
30 classes/**'
31 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()