From 39d9f899d21c22f81e90c9f33b2776814e52e0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Fri, 29 Nov 2024 11:39:36 +0100 Subject: [PATCH] .github/workflows/build: use pengutronix-hosted runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a backport of the workflow file on master adapted to build for kirkstone. Signed-off-by: Leonard Göhrs --- .github/workflows/build.yml | 74 ++++++++++++++++++++++++++++++++++ .github/workflows/meta-ptx.yml | 52 ------------------------ 2 files changed, 74 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/meta-ptx.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..97024fd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,74 @@ +name: build + +on: + push: {} + pull_request: {} + # allow rebuilding without a push + workflow_dispatch: {} + +jobs: + build: + name: meta-ptx Build + # run on self-hosted runner for the main repo or if vars.BUILD_RUNS_ON is set + runs-on: >- + ${{ + (vars.BUILD_RUNS_ON != '' && fromJSON(vars.BUILD_RUNS_ON)) || + (github.repository == 'pengutronix/meta-ptx' && fromJSON('["self-hosted", "forrest", "build"]')) || + 'ubuntu-20.04' + }} + # abort if it seems that we're rebuilding too much + timeout-minutes: 120 + steps: + - name: Install required packages + run: | + sudo apt-get -q -y --no-install-recommends install diffstat python3-distutils + - name: Checkout + uses: actions/checkout@v4 + with: + path: meta-ptx + - name: Clone poky + run: git clone --shared --reference-if-able /srv/shared-git/poky.git -b kirkstone https://github.com/yoctoproject/poky.git + - name: Clone meta-openembedded + run: git clone --shared --reference-if-able /srv/shared-git/meta-openembedded.git -b kirkstone https://github.com/openembedded/meta-openembedded.git + - name: Initialize build directory + run: | + source poky/oe-init-build-env build + bitbake-layers add-layer ../meta-openembedded/meta-oe + bitbake-layers add-layer ../meta-ptx + if [ -f ~/.yocto/auto.conf ]; then + cp ~/.yocto/auto.conf conf/ + else + echo 'SSTATE_MIRRORS = "file://.* https://github-runner.pengutronix.de/sstate-cache/PATH"' >> conf/auto.conf + echo 'BB_SIGNATURE_HANDLER = "OEBasicHash"' >> conf/auto.conf + echo 'BB_HASHSERVE = ""' >> conf/auto.conf + echo 'OPKGBUILDCMD = "opkg-build -Z gzip -a -1n"' >> conf/auto.conf + echo 'INHERIT += "rm_work"' >> conf/auto.conf + fi + echo 'DISTRO_FEATURES:remove = "alsa bluetooth usbgadget usbhost wifi nfs zeroconf pci 3g nfc x11 opengl ptest wayland vulkan"' >> conf/local.conf + - name: Build barebox + run: | + source poky/oe-init-build-env build + echo 'BAREBOX_CONFIG = "efi_defconfig"' >> conf/local.conf + bitbake barebox + - name: Build genimage, genimage-native + run: | + source poky/oe-init-build-env build + bitbake genimage genimage-native + - name: Build dt-utils + run: | + source poky/oe-init-build-env build + bitbake dt-utils + - name: Build microcom + run: | + source poky/oe-init-build-env build + bitbake microcom + - name: Cache Data + env: + CACHE_KEY: ${{ secrets.YOCTO_CACHE_KEY }} + if: ${{ env.CACHE_KEY }} + run: | + mkdir -p ~/.ssh + echo "$CACHE_KEY" >> ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + rsync -rvx --ignore-existing build/downloads yocto-cache: || true + rsync -rvx --ignore-existing build/sstate-cache yocto-cache: || true diff --git a/.github/workflows/meta-ptx.yml b/.github/workflows/meta-ptx.yml deleted file mode 100644 index 29387b6..0000000 --- a/.github/workflows/meta-ptx.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: meta-ptx CI - -on: - # Trigger the workflow on push or pull request, - # but only for the kirkstone branch - push: - branches: - - kirkstone - pull_request: - branches: - - kirkstone -jobs: - build: - name: meta-ptx Build - runs-on: ubuntu-20.04 - timeout-minutes: 720 - steps: - - name: Install required packages - run: | - sudo apt-get install diffstat - - name: Checkout - uses: actions/checkout@v2 - with: - path: meta-ptx - - name: Clone poky - run: git clone -b kirkstone git://git.yoctoproject.org/poky - - name: Clone meta-openembedded - run: git clone -b kirkstone https://github.com/openembedded/meta-openembedded.git - - name: Initialize build directory - run: | - source poky/oe-init-build-env build - bitbake-layers add-layer ../meta-ptx - echo 'INHERIT += "rm_work"' >> conf/local.conf - echo 'DISTRO_FEATURES:remove = "alsa bluetooth usbgadget usbhost wifi nfs zeroconf pci 3g nfc x11 opengl ptest wayland vulkan"' >> conf/local.conf - echo 'SSTATE_MIRRORS = "file://.* http://195.201.147.117/sstate-cache/PATH"' >> conf/local.conf - - name: Build barebox - run: | - source poky/oe-init-build-env build - echo 'BAREBOX_CONFIG = "efi_defconfig"' >> conf/local.conf - bitbake barebox - - name: Build genimage, genimage-native - run: | - source poky/oe-init-build-env build - bitbake genimage genimage-native - - name: Build dt-utils - run: | - source poky/oe-init-build-env build - bitbake dt-utils - - name: Build microcom - run: | - source poky/oe-init-build-env build - bitbake microcom