From 5c9fdfa597672de1224193904cff6b8a5c9314e8 Mon Sep 17 00:00:00 2001 From: "Vipul Gupta (@vipulgupta2048)" Date: Fri, 9 Aug 2024 02:00:09 +0530 Subject: [PATCH] Add test-private device repository Signed-off-by: Vipul Gupta (@vipulgupta2048) --- .../{raspberrypi3.yml => test-private.yml} | 30 ++++++------- .../conf/machine/test-private.conf | 11 +++++ .../conf/samples/local.conf.sample | 1 + test-private.coffee | 42 +++++++++++++++++++ 4 files changed, 66 insertions(+), 18 deletions(-) rename .github/workflows/{raspberrypi3.yml => test-private.yml} (61%) create mode 100644 layers/meta-balena-raspberrypi/conf/machine/test-private.conf create mode 100644 test-private.coffee diff --git a/.github/workflows/raspberrypi3.yml b/.github/workflows/test-private.yml similarity index 61% rename from .github/workflows/raspberrypi3.yml rename to .github/workflows/test-private.yml index 4b850d8cc..e82b7fbef 100644 --- a/.github/workflows/raspberrypi3.yml +++ b/.github/workflows/test-private.yml @@ -1,6 +1,10 @@ -name: Raspberry Pi 3 +name: Test Private on: + # With these triggers the Yocto jobs will run + # in parallel with the Flowzone jobs, which is fine for now + # and allows us to better control what we want to test and when. + # It is expected that Flowzone could fail, but yocto jobs will run. pull_request: branches: - "main" @@ -9,39 +13,29 @@ on: branches: - "main" - "master" - push: tags: - v[0-9]+.[0-9]+.[0-9]+\+?r?e?v?* - v20[0-9][0-9].[0-1]?[1470].[0-9]+ - workflow_dispatch: - jobs: yocto: name: Yocto - # Pin the workflow to a specific commit to prevent unexpected changes while - # I am learning. - uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml@ad06820f4174568383678710fa68b2054da6db57 + uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml # Prevent duplicate workflow executions for pull_request (PR) and pull_request_target (PRT) events. # Both PR and PRT will be triggered for the same pull request, whether it is internal or from a fork. # This condition will prevent the workflow from running twice for the same pull request while # still allowing it to run for all other event types. - # - internal PR (true == true) ok - # - internal PRT (true != false) skip - # - fork PR (false != true) skip - # - fork PRT (false == false) ok - # - push (false == false) ok - # - workflow_dispatch (false == false) ok - # - any trigger other than PR/PRT (false == false) ok if: (github.event.pull_request.head.repo.full_name == github.repository) == (github.event_name == 'pull_request') secrets: inherit with: - machine: raspberrypi3 + machine: test-private + # Needed for testing - defaults to production environment: balena-staging.com + deploy-hostapp: true # needed for testing deploy test_matrix: > { - "test_suite": ["os"], + "test_suite": ["os","cloud","hup"], "environment": ["bm.balena-dev.com"], - "worker_type": ["testbot"], - } + "runs_on": [["ubuntu-latest"]] + } \ No newline at end of file diff --git a/layers/meta-balena-raspberrypi/conf/machine/test-private.conf b/layers/meta-balena-raspberrypi/conf/machine/test-private.conf new file mode 100644 index 000000000..9fdcc3a84 --- /dev/null +++ b/layers/meta-balena-raspberrypi/conf/machine/test-private.conf @@ -0,0 +1,11 @@ +#@TYPE: Machine +##@NAME: test-private +##@DESCRIPTION: Machine configuration for an extra configured genericx86-64 device + + +MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" +include conf/machine/raspberrypi3.conf + +# FIRMWARE_COMPRESSION ?= "1" + +# MACHINE_FEATURES += " efi raid" \ No newline at end of file diff --git a/layers/meta-balena-raspberrypi/conf/samples/local.conf.sample b/layers/meta-balena-raspberrypi/conf/samples/local.conf.sample index b1354b6b5..3d1680be2 100644 --- a/layers/meta-balena-raspberrypi/conf/samples/local.conf.sample +++ b/layers/meta-balena-raspberrypi/conf/samples/local.conf.sample @@ -2,6 +2,7 @@ #MACHINE ?= "raspberrypi" #MACHINE ?= "raspberrypi2" #MACHINE ?= "raspberrypi3" +#MACHINE ?= "test-private" #MACHINE ?= "raspberrypi3-64" #MACHINE ?= "revpi-connect" #MACHINE ?= "revpi-connect-s" diff --git a/test-private.coffee b/test-private.coffee new file mode 100644 index 000000000..776495d03 --- /dev/null +++ b/test-private.coffee @@ -0,0 +1,42 @@ +deviceTypesCommon = require '@resin.io/device-types/common' +{ networkOptions, commonImg, instructions } = deviceTypesCommon + +module.exports = + version: 1 + slug: 'test-private' + aliases: [ 'test-private' ] + name: 'Test Private' + arch: 'armv7hf' + state: 'released' + isDefault: true + + imageDownloadAlerts: [ + { + type: 'warning' + message: 'The Raspberry Pi 3 is not capable of connecting to 5GHz WiFi networks unless you use an external WiFi adapter that supports it. The Raspberry Pi 3 B+ is capable of connecting to both 5GHz and 2.4GHz networks.' + } + ] + + instructions: commonImg.instructions + gettingStartedLink: + windows: 'https://www.balena.io/docs/learn/getting-started/test-private/nodejs/' + osx: 'https://www.balena.io/docs/learn/getting-started/test-private/nodejs/' + linux: 'https://www.balena.io/docs/learn/getting-started/test-private/nodejs/' + + options: [ networkOptions.group ] + + yocto: + machine: 'test-private' + image: 'balena-image' + fstype: 'balenaos-img' + version: 'yocto-kirkstone' + deployArtifact: 'balena-image-test-private.balenaos-img' + compressed: true + + configuration: + config: + partition: + primary: 1 + path: '/config.json' + + initialization: commonImg.initialization