Skip to content

Commit

Permalink
add leviathan prep and device-repo example pseudocode
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: Ryan Cooke <[email protected]>
  • Loading branch information
rcooke-warwick committed Apr 19, 2024
1 parent 2b2f795 commit a8432c5
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/repo-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Yocto build
# device repo example psuedo code for visualisation purposes

on:
pull_request:
branches:
- main
- master

jobs:
yocto-generic-amd64:
uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build.yml@<tag>
secrets: inherit
with:
machine: generic-amd64
sign-image: true
development-mode: false
environment: 'production' # used to select prod api key , # prod api url # SSH url = blank
... etc

Check failure on line 19 in .github/workflows/repo-example.yml

View workflow job for this annotation

GitHub Actions / Flowzone / Lint workflows

could not parse as YAML: yaml: line 19: could not find expected ':'

generic-aarch64:
uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build.yml@<tag>
secrets: inherit
with:
machine: generic-aarch64
sign-image: false
development-mode: true
environment: 'balena-machine' # have a github env with SSH port , ssh URL
... etc

47 changes: 41 additions & 6 deletions .github/workflows/yocto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ jobs:
#du -cksh shared/yocto-cache/$(whoami)/*
# TODO: pre-install on self-hosted-runners
- name: Install zip package
- name: Install zip packages
run: |
sudo apt-get update
sudo apt-get install -y zip
sudo apt-get install -y zip gzip
- name: Export prepare artifacts deploy path to env
env:
Expand Down Expand Up @@ -354,14 +354,49 @@ jobs:
# Move the generated balena.yml into the deploy folder for easier access in deploy job
mv ${WORKSPACE}/balena.yml ${DEPLOY_PATH}
#TODO: select correct api key (balena machine or prod)

- name : Prepare Leviathan inputs
run: |
# create "workspace" directory
echo LEVIATHAN_WORKSPACE="${WORKSPACE}/leviathan-workspace" >> $GITHUB_ENV
mkdir -p ${LEVIATHAN_WORKSPACE}
# Set suites location
echo LEVIATHAN_SUITES="${WORKSPACE}/layers/meta-balena/tests/suites" >> $GITHUB_ENV
# Copy config.js and image to leviathan workspace, and gzip (leviathan expects gzipped image)
cp ${LEVIATHAN_SUITES}/config.js ${LEVIATHAN_WORKSPACE}/config.js
cp ${DEPLOY_PATH}/image/balena.img ${LEVIATHAN_WORKSPACE}/balena.img
gzip ${LEVIATHAN_WORKSPACE}/balena.img
# Create reports folder
echo LEVIATHAN_REPORTS="${WORKSPACE/leviathan-reports" >> $GITHUB_ENV
mkdir -p ${LEVIATHAN_REPORTS}
# TODO: add test step/steps here??
# img location = ${DEPLOY_PATH}/image/balena.img
# suites location = ${WORKSPACE/layers/meta-balena/tests}
# config.json location = doesn't exist
# leviathan workspace folder = doesn't exist
# Set the envs for the step
# SUITES: ${{ env.LEVIATHAN_SUITES }}
# WORKSPACE: ${{ env.LEVIATHAN_WORKSPACE }}
# REPORTS: ${{ env.LEVIATHAN_REPORTS }}
# - name: leviathan...
# uses: leviathan-action.....
# env:
# SUITES: ${{ env.LEVIATHAN_SUITES }}
# matrix: | - pointless to split at the moment, as if they're not in a seperate job, you won't be able to retry anyway
# os
# hup
# cloud
# sb-os
# sb-hup

## IF inputs.sign-image === true
## Do another leviathan with QEMU_SECUREBOOT = 1??

# TODO: bundle artifacts separately for convience
# https://github.com/actions/upload-artifact
# ALSO need the flasher and raw artifacts as image maker expects them
- name: Upload artifacts
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
Expand Down

0 comments on commit a8432c5

Please sign in to comment.