yocto-builds.yml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # SPDX-FileCopyrightText: Andrei Gherzan <andrei.gherzan@huawei.com>
  2. #
  3. # SPDX-License-Identifier: MIT
  4. ---
  5. name: Builds
  6. on:
  7. pull_request:
  8. jobs:
  9. build:
  10. strategy:
  11. fail-fast: true
  12. matrix:
  13. machine:
  14. - raspberrypi
  15. - raspberrypi0-2w-64
  16. - raspberrypi0-2w
  17. - raspberrypi0
  18. - raspberrypi0-wifi
  19. - raspberrypi2
  20. - raspberrypi3-64
  21. - raspberrypi3
  22. - raspberrypi4-64
  23. - raspberrypi4
  24. - raspberrypi5
  25. - raspberrypi-cm3
  26. - raspberrypi-cm
  27. - raspberrypi-armv7
  28. - raspberrypi-armv8
  29. image: [rpi-test-image]
  30. distro: [poky]
  31. runs-on: [self-hosted, Linux]
  32. name: ${{ matrix.machine }}/${{ matrix.image }}/poky/systemd
  33. env:
  34. DL_DIR: /var/lib/ci/yocto/downloads
  35. SSTATE_DIR: /var/lib/ci/yocto/sstate
  36. steps:
  37. - name: Checkout the code
  38. uses: actions/checkout@v3
  39. with:
  40. fetch-depth: 0
  41. - name: Define Yocto build files
  42. id: changed-files-specific
  43. uses: tj-actions/changed-files@v24
  44. with:
  45. files: |
  46. .github/actions/**
  47. .github/workflows/docker-images/yocto-builder/**
  48. .github/workflows/docker-images/*.sh
  49. .github/workflows/yocto-builds.yml
  50. classes/**
  51. conf/**
  52. dynamic-layers/**
  53. files/**
  54. lib/**
  55. recipes-**
  56. wic/**
  57. - name: Build a temporary yocto-builder image
  58. uses: ./.github/actions/docker-build
  59. with:
  60. docker_image: yocto-builder
  61. id: ${{ github.event.number }}
  62. if: steps.changed-files-specific.outputs.any_changed == 'true'
  63. - name: Build the image
  64. run: |
  65. docker run --rm --security-opt apparmor=unconfined \
  66. --security-opt seccomp=unconfined \
  67. -v "$GITHUB_WORKSPACE:/work:ro" \
  68. -v "$DL_DIR:$DL_DIR:rw" \
  69. -v "$SSTATE_DIR:$SSTATE_DIR:rw" \
  70. --env "BASE_REF=$GITHUB_BASE_REF" \
  71. --env "MACHINE=${{ matrix.machine }}" \
  72. --env "DISTRO=${{ matrix.distro }}" \
  73. --env "IMAGE=${{ matrix.image }}" \
  74. --env "DL_DIR=$DL_DIR" \
  75. --env "SSTATE_DIR=$SSTATE_DIR" \
  76. --ulimit "nofile=1024:1048576" \
  77. "yocto-builder-${{ github.event.number }}" \
  78. /entrypoint-build.sh
  79. if: steps.changed-files-specific.outputs.any_changed == 'true'
  80. - name: Cleanup temporary docker image
  81. uses: ./.github/actions/docker-clean-image
  82. with:
  83. docker_image: yocto-builder-${{ github.event.number }}
  84. if: always()
  85. - name: Cleanup dangling docker images
  86. uses: ./.github/actions/docker-clean-dangling
  87. if: always()