|
| 1 | +name: Yocto Layer Validation |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'conan2/*' ] |
| 6 | + pull_request: |
| 7 | + branches: [ 'conan2/*' ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + validate-layer: |
| 11 | + runs-on: ubuntu-22.04 |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Extract Yocto release name |
| 15 | + run: | |
| 16 | + BRANCH_NAME=${GITHUB_REF#refs/heads/} |
| 17 | + if [[ $BRANCH_NAME == "conan2/"* ]]; then |
| 18 | + YOCTO_RELEASE=$(echo $BRANCH_NAME | cut -d'/' -f2) |
| 19 | + else |
| 20 | + YOCTO_RELEASE=$(echo $GITHUB_BASE_REF | cut -d'/' -f2) |
| 21 | + fi |
| 22 | + echo "YOCTO_RELEASE=$YOCTO_RELEASE" >> $GITHUB_ENV |
| 23 | +
|
| 24 | + - name: Checkout meta-conan |
| 25 | + uses: actions/checkout@v3 |
| 26 | + with: |
| 27 | + path: meta-conan |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + env: |
| 31 | + DEBIAN_FRONTEND: noninteractive |
| 32 | + run: | |
| 33 | + sudo apt-get -qq update |
| 34 | + sudo apt-get -qq install -y --no-install-recommends --no-install-suggests \ |
| 35 | + gawk wget git diffstat unzip texinfo gcc build-essential \ |
| 36 | + chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \ |
| 37 | + iputils-ping python3-git python3-jinja2 libegl1-mesa-dev libsdl1.2-dev pylint xterm |
| 38 | +
|
| 39 | + - name: Clone Poky |
| 40 | + run: | |
| 41 | + git clone -b ${{ env.YOCTO_RELEASE }} --depth 1 git://git.yoctoproject.org/poky |
| 42 | + cd poky |
| 43 | + git checkout -q ${{ env.YOCTO_RELEASE }} |
| 44 | +
|
| 45 | + - name: Clone meta-openembedded |
| 46 | + run: | |
| 47 | + git clone -b ${{ env.YOCTO_RELEASE }} --depth 1 git://git.openembedded.org/meta-openembedded |
| 48 | + cd meta-openembedded |
| 49 | + git checkout -q ${{ env.YOCTO_RELEASE }} |
| 50 | +
|
| 51 | + - name: Add Conan Mosquitto example |
| 52 | + run: | |
| 53 | + mkdir recipes-example |
| 54 | + echo 'inherit conan' > recipes-example/conan-mosquitto_2.0.18.bb |
| 55 | + echo 'DESCRIPTION = "An open source MQTT broker"' >> recipes-example/conan-mosquitto_2.0.18.bb |
| 56 | + echo 'LICENSE = "EPL-1.0"' >> recipes-example/conan-mosquitto_2.0.18.bb |
| 57 | + echo 'CONAN_PKG = "mosquitto/2.0.18"' >> recipes-example/conan-mosquitto_2.0.18.bb |
| 58 | +
|
| 59 | + - name: Setup build environment |
| 60 | + run: | |
| 61 | + source poky/oe-init-build-env build |
| 62 | +
|
| 63 | + echo 'IMAGE_INSTALL:append = " conan-mosquitto"' >> ${{ github.workspace }}/build/conf/local.conf |
| 64 | + echo 'CONAN_BUILD_POLICY = "missing"' >> ${{ github.workspace }}/build/conf/local.conf |
| 65 | +
|
| 66 | + bitbake-layers add-layer ../meta-openembedded/meta-oe |
| 67 | + bitbake-layers add-layer ../meta-openembedded/meta-python |
| 68 | + bitbake-layers add-layer ../meta-conan |
| 69 | +
|
| 70 | + bitbake-layers show-layers |
0 commit comments