Skip to content

Commit

Permalink
Fixup GH actions for kirkstone
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Armstrong <[email protected]>
  • Loading branch information
superna9999 committed Nov 3, 2023
1 parent 2255f69 commit 1b0e973
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 0 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/build-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
on:
workflow_call:
inputs:
host:
required: true
type: string
images:
required: true
type: string
machines:
required: true
type: string
url:
required: true
type: string
branch:
required: true
type: string
ref:
required: true
type: string
ref_type:
type: string
default: ref
tclibc:
type: string
default: glibc
secrets:
TUXSUITE_TOKEN:
required: true

env:
POKY_URL: https://git.yoctoproject.org/poky
DISTRO: poky

jobs:
build:
name: ${{github.event_name}} - ${{github.ref}}
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade tuxsuite
- name: Setup tux plan
run: |
cat << EOF > plan.yaml
name: CI for ${{github.repository}}
description: ${{github.workflow}} - ${{github.ref}}
version: 1
common: &commondata
container: ${{inputs.host}}
envsetup: poky/oe-init-build-env
sources:
git_trees:
- branch: ${{inputs.branch}}
url: $POKY_URL
- ${{inputs.ref_type}}: ${{inputs.ref}}
url: ${{inputs.url}}
distro: $DISTRO
target: ${{inputs.images}}
bblayers_conf:
- BBLAYERS += '../$(echo ${{github.repository}} | cut -d'/' -f2)'
artifacts: []
EOF
for tclibc in ${{inputs.tclibc}}; do
cat << EOF >> plan.yaml
${tclibc}: &${tclibc}
local_conf:
- INHERIT += 'buildstats buildstats-summary'
- INHERIT:remove = 'rm_work'
- TCLIBC := '${tclibc}'
EOF
done
cat << EOF >> plan.yaml
jobs:
EOF
for tclibc in ${{inputs.tclibc}}; do
cat << EOF >> plan.yaml
- name: ${tclibc}
bakes:
EOF
for machine in ${{inputs.machines}}; do
cat << EOF >> plan.yaml
- { <<: [*commondata, *${tclibc}], machine: ${machine}, name: ${machine}-${tclibc} }
EOF
done
done
echo "Ready to submit this Tux Plan:"
cat plan.yaml
- name: Run build
run: |
tuxsuite plan plan.yaml
env:
TUXSUITE_TOKEN: ${{ secrets.TUXSUITE_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Pull Request Build

on:
pull_request_target:
branches:
- kirkstone

jobs:
build:
uses: ./.github/workflows/build-template.yml
with:
host: ubuntu-20.04
images: core-image-base core-image-weston core-image-x11 amlogic-image-headless-initrd amlogic-image-headless-sd amlogic-image-sato
machines: amlogic-p200 amlogic-p200-sdboot amlogic-p201-sdboot amlogic-p212 amlogic-p212-sdboot amlogic-s400 friendlyelec-nanopik2 hardkernel-odroidc2 hardkernel-odroidc2-sdboot hardkernel-odroidc4 hardkernel-odroidc4-sdboot hardkernel-odroidhc4 hardkernel-odroidhc4-sdboot hardkernel-odroidn2 hardkernel-odroidn2-sdboot hardkernel-odroidn2plus hardkernel-odroidn2plus-sdboot khadas-vim khadas-vim-sdboot khadas-vim2 khadas-vim3 khadas-vim3-sdboot khadas-vim3l khadas-vim3l-sdboot libretech-ac libretech-cc radxa-zero seirobotics-sei510 seirobotics-sei610
ref: refs/pull/${{github.event.pull_request.number}}/merge
branch: ${{github.base_ref}}
url: ${{github.server_url}}/${{github.repository}}
secrets:
TUXSUITE_TOKEN: ${{ secrets.TUXSUITE_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Push Build

on:
push:
branches:
- kirkstone

jobs:
build:
uses: ./.github/workflows/build-template.yml
with:
host: ubuntu-20.04
images: core-image-base core-image-weston core-image-x11 amlogic-image-headless-initrd amlogic-image-headless-sd amlogic-image-sato
machines: amlogic-p200 amlogic-p200-sdboot amlogic-p201-sdboot amlogic-p212 amlogic-p212-sdboot amlogic-s400 friendlyelec-nanopik2 hardkernel-odroidc2 hardkernel-odroidc2-sdboot hardkernel-odroidc4 hardkernel-odroidc4-sdboot hardkernel-odroidhc4 hardkernel-odroidhc4-sdboot hardkernel-odroidn2 hardkernel-odroidn2-sdboot hardkernel-odroidn2plus hardkernel-odroidn2plus-sdboot khadas-vim khadas-vim-sdboot khadas-vim2 khadas-vim3 khadas-vim3-sdboot khadas-vim3l khadas-vim3l-sdboot libretech-ac libretech-cc radxa-zero seirobotics-sei510 seirobotics-sei610
ref_type: sha
ref: ${{github.sha}}
branch: ${{github.ref_name}}
url: ${{github.server_url}}/${{github.repository}}
secrets:
TUXSUITE_TOKEN: ${{ secrets.TUXSUITE_TOKEN }}

0 comments on commit 1b0e973

Please sign in to comment.