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: Yocto Compatible |
| 8 | |
| 9 | on: |
| 10 | pull_request: |
| 11 | |
| 12 | jobs: |
| 13 | yocto-check-layer: |
| 14 | name: Validate with yocto-check-layer |
| 15 | runs-on: [self-hosted, Linux] |
| 16 | steps: |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 17 | - 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 |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 30 | classes/** |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 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() |