From cf3e218f5798ba1e421268d079c429102ae9380b Mon Sep 17 00:00:00 2001 From: Bastian Krause Date: Tue, 4 Jul 2023 13:32:40 +0200 Subject: [PATCH 1/9] github/workflows: update GitHub-hosted runner Ubuntu image 20.04 -> 22.04 Explicit installation of chrpath is now required: ERROR: The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed: chrpath Signed-off-by: Bastian Krause --- .github/workflows/meta-labgrid.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meta-labgrid.yml b/.github/workflows/meta-labgrid.yml index f8da888..119b181 100644 --- a/.github/workflows/meta-labgrid.yml +++ b/.github/workflows/meta-labgrid.yml @@ -12,12 +12,12 @@ on: jobs: build: name: meta-labgrid Build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 720 steps: - name: Install required packages run: | - sudo apt-get install diffstat + sudo apt-get install diffstat chrpath - name: Checkout uses: actions/checkout@v2 with: From e09f83bbe36082d08badb730968b3aac3a504296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Mon, 21 Oct 2024 10:23:46 +0200 Subject: [PATCH 2/9] .github/workflows/build: also build for branches other than master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The self hosted runner and prepared sstate has made building a lot cheaper in terms of CPU minutes used, so we can afford to build other branches as well. Since we are on the kirkstone branch use this branch for poky and meta-oe as well. Signed-off-by: Leonard Göhrs --- .github/workflows/meta-labgrid.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/meta-labgrid.yml b/.github/workflows/meta-labgrid.yml index 119b181..f39fb3a 100644 --- a/.github/workflows/meta-labgrid.yml +++ b/.github/workflows/meta-labgrid.yml @@ -1,14 +1,9 @@ name: meta-labgrid CI on: - # Trigger the workflow on push or pull request, - # but only for the master branch - push: - branches: - - master - pull_request: - branches: - - master + push: {} + pull_request: {} + jobs: build: name: meta-labgrid Build @@ -23,9 +18,9 @@ jobs: with: path: meta-labgrid - name: Clone poky - run: git clone -b master git://git.yoctoproject.org/poky + run: git clone -b kirkstone git://git.yoctoproject.org/poky - name: Clone meta-openembedded - run: git clone -b master https://github.com/openembedded/meta-openembedded.git + run: git clone -b kirkstone https://github.com/openembedded/meta-openembedded.git - name: Initialize build directory run: | source poky/oe-init-build-env build From ff7444e190ced3c4bc5d7212ac01ce8b884b85b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Mon, 21 Oct 2024 10:27:07 +0200 Subject: [PATCH 3/9] .github/workflows/build: allow triggering jobs via workflow_dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow_dispatch trigger allows triggering a rebuild for a specific branch via the web interface and the API without having to push a dummy commit or other workarounds. This also allows us to run scheduled jobs for branches other than "master" by using a scheduled job on master that trigger jobs on other branches via the API. Signed-off-by: Leonard Göhrs --- .github/workflows/meta-labgrid.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/meta-labgrid.yml b/.github/workflows/meta-labgrid.yml index f39fb3a..5e31b97 100644 --- a/.github/workflows/meta-labgrid.yml +++ b/.github/workflows/meta-labgrid.yml @@ -3,6 +3,8 @@ name: meta-labgrid CI on: push: {} pull_request: {} + # allow rebuilding without a push + workflow_dispatch: {} jobs: build: From 770d1fb2b0c43b068d3f3ae89258d3cdaa089799 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 23 Aug 2024 16:22:09 +0200 Subject: [PATCH 4/9] .github/workflows: rename from meta-labgrid.yml to build.yml There is no need to name it after the layer and build.yml can be consistent with other layers. Signed-off-by: Jan Luebbe --- .github/workflows/{meta-labgrid.yml => build.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{meta-labgrid.yml => build.yml} (98%) diff --git a/.github/workflows/meta-labgrid.yml b/.github/workflows/build.yml similarity index 98% rename from .github/workflows/meta-labgrid.yml rename to .github/workflows/build.yml index 5e31b97..a0e112c 100644 --- a/.github/workflows/meta-labgrid.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: meta-labgrid CI +name: build on: push: {} From 36545506ed7255bb7505d58714c570dcae7e7831 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 23 Aug 2024 15:04:10 +0200 Subject: [PATCH 5/9] .github/workflows/build: update to actions/checkout@v4 Signed-off-by: Jan Luebbe --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0e112c..4516423 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: run: | sudo apt-get install diffstat chrpath - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: meta-labgrid - name: Clone poky From aa69996ad885709068052b289f40cb7405302468 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 23 Aug 2024 15:05:25 +0200 Subject: [PATCH 6/9] .github/workflows/build: run apt-get with options for CI We don't want apt to install recommended packages or ask for confirmation. Signed-off-by: Jan Luebbe --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4516423..5c4d1eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Install required packages run: | - sudo apt-get install diffstat chrpath + sudo apt-get -q -y --no-install-recommends install diffstat chrpath - name: Checkout uses: actions/checkout@v4 with: From 6a5d000629c9ec337799b471f9107dcc36775a9a Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 23 Aug 2024 15:06:31 +0200 Subject: [PATCH 7/9] .github/workflows/build: use shared git repo if available This improves performance when building on prepared runners. Signed-off-by: Jan Luebbe --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c4d1eb..c63eec7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,9 +20,9 @@ jobs: with: path: meta-labgrid - name: Clone poky - run: git clone -b kirkstone git://git.yoctoproject.org/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 -b kirkstone https://github.com/openembedded/meta-openembedded.git + 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 From 547ad0eb8caac4e0909f742060e9d4b6310076ec Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 23 Aug 2024 16:28:10 +0200 Subject: [PATCH 8/9] .github/workflows/build: use pengutronix-hosted runner Signed-off-by: Jan Luebbe --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c63eec7..11bb9de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,15 @@ on: jobs: build: name: meta-labgrid Build - runs-on: ubuntu-22.04 - timeout-minutes: 720 + # 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 == 'labgrid-project/meta-labgrid' && fromJSON('["self-hosted", "forrest", "build"]')) || + 'ubuntu-22.04' + }} + # abort if it seems that we're rebuilding too much + timeout-minutes: 120 steps: - name: Install required packages run: | @@ -29,9 +36,16 @@ jobs: bitbake-layers add-layer ../meta-openembedded/meta-oe bitbake-layers add-layer ../meta-openembedded/meta-python bitbake-layers add-layer ../meta-labgrid - echo 'INHERIT += "rm_work"' >> conf/local.conf + 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 - echo 'SSTATE_MIRRORS = "file://.* http://195.201.147.117/sstate-cache/PATH"' >> conf/local.conf - name: Build autobahn run: | source poky/oe-init-build-env build @@ -44,3 +58,13 @@ jobs: run: | source poky/oe-init-build-env build bitbake python3-pyserial sispmctl + - 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 From dcf91ab85e64ce2a39b7aea172cbfd528585186a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Mon, 21 Oct 2024 11:22:10 +0200 Subject: [PATCH 9/9] .github/workflows/build: install python3-distutils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the following error when building on our Debian bookworm based self-hosted runner: > ERROR: OE-core's config sanity checker detected a potential misconfiguration. > Either fix the cause of this error or at your own risk disable the checker (see sanity.conf). > Following is the list of potential problems / advisories: > > Your Python 3 is not a full install. Please install the module distutils.sysconfig (see the Getting Started guide for further information). Signed-off-by: Leonard Göhrs --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11bb9de..8d1ab43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Install required packages run: | - sudo apt-get -q -y --no-install-recommends install diffstat chrpath + sudo apt-get -q -y --no-install-recommends install diffstat chrpath python3-distutils - name: Checkout uses: actions/checkout@v4 with: