|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + push: {} |
| 5 | + pull_request: {} |
| 6 | + # allow rebuilding without a push |
| 7 | + workflow_dispatch: {} |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: meta-labgrid Build |
| 12 | + # run on self-hosted runner for the main repo or if vars.BUILD_RUNS_ON is set |
| 13 | + runs-on: >- |
| 14 | + ${{ |
| 15 | + (vars.BUILD_RUNS_ON != '' && fromJSON(vars.BUILD_RUNS_ON)) || |
| 16 | + (github.repository == 'labgrid-project/meta-labgrid' && fromJSON('["self-hosted", "forrest", "build"]')) || |
| 17 | + 'ubuntu-22.04' |
| 18 | + }} |
| 19 | + # abort if it seems that we're rebuilding too much |
| 20 | + timeout-minutes: 120 |
| 21 | + steps: |
| 22 | + - name: Install required packages |
| 23 | + run: | |
| 24 | + sudo apt-get -q -y --no-install-recommends install diffstat chrpath python3-distutils |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + path: meta-labgrid |
| 29 | + - name: Clone poky |
| 30 | + run: git clone --shared --reference-if-able /srv/shared-git/poky.git -b kirkstone https://github.com/yoctoproject/poky.git |
| 31 | + - name: Clone meta-openembedded |
| 32 | + run: git clone --shared --reference-if-able /srv/shared-git/meta-openembedded.git -b kirkstone https://github.com/openembedded/meta-openembedded.git |
| 33 | + - name: Initialize build directory |
| 34 | + run: | |
| 35 | + source poky/oe-init-build-env build |
| 36 | + bitbake-layers add-layer ../meta-openembedded/meta-oe |
| 37 | + bitbake-layers add-layer ../meta-openembedded/meta-python |
| 38 | + bitbake-layers add-layer ../meta-labgrid |
| 39 | + if [ -f ~/.yocto/auto.conf ]; then |
| 40 | + cp ~/.yocto/auto.conf conf/ |
| 41 | + else |
| 42 | + echo 'SSTATE_MIRRORS = "file://.* https://github-runner.pengutronix.de/sstate-cache/PATH"' >> conf/auto.conf |
| 43 | + echo 'BB_SIGNATURE_HANDLER = "OEBasicHash"' >> conf/auto.conf |
| 44 | + echo 'BB_HASHSERVE = ""' >> conf/auto.conf |
| 45 | + echo 'OPKGBUILDCMD = "opkg-build -Z gzip -a -1n"' >> conf/auto.conf |
| 46 | + echo 'INHERIT += "rm_work"' >> conf/auto.conf |
| 47 | + fi |
| 48 | + echo 'DISTRO_FEATURES:remove = "alsa bluetooth usbgadget usbhost wifi nfs zeroconf pci 3g nfc x11 opengl ptest wayland vulkan"' >> conf/local.conf |
| 49 | + - name: Build autobahn |
| 50 | + run: | |
| 51 | + source poky/oe-init-build-env build |
| 52 | + bitbake python3-autobahn |
| 53 | + - name: Build labgrid |
| 54 | + run: | |
| 55 | + source poky/oe-init-build-env build |
| 56 | + bitbake python3-labgrid |
| 57 | + - name: Build tools |
| 58 | + run: | |
| 59 | + source poky/oe-init-build-env build |
| 60 | + bitbake python3-pyserial sispmctl |
| 61 | + - name: Cache Data |
| 62 | + env: |
| 63 | + CACHE_KEY: ${{ secrets.YOCTO_CACHE_KEY }} |
| 64 | + if: ${{ env.CACHE_KEY }} |
| 65 | + run: | |
| 66 | + mkdir -p ~/.ssh |
| 67 | + echo "$CACHE_KEY" >> ~/.ssh/id_ed25519 |
| 68 | + chmod 600 ~/.ssh/id_ed25519 |
| 69 | + rsync -rvx --ignore-existing build/downloads yocto-cache: || true |
| 70 | + rsync -rvx --ignore-existing build/sstate-cache yocto-cache: || true |
0 commit comments