aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/build-template.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build-template.yml')
-rw-r--r--.github/workflows/build-template.yml113
1 files changed, 113 insertions, 0 deletions
diff --git a/.github/workflows/build-template.yml b/.github/workflows/build-template.yml
new file mode 100644
index 0000000..3118434
--- /dev/null
+++ b/.github/workflows/build-template.yml
@@ -0,0 +1,113 @@
+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
+ secrets:
+ TUXSUITE_TOKEN:
+ required: true
+
+env:
+ POKY_URL: https://git.yoctoproject.org/poky
+ DISTRO: poky
+ TCLIBC: glibc musl
+ KERNELS: linaro-qcomlt yocto
+
+jobs:
+ build:
+ name: ${{github.event_name}} - ${{github.ref}}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ 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 ${TCLIBC}; do
+ for kernel in ${KERNELS}; do
+ cat << EOF >> plan.yaml
+ ${tclibc}-${kernel}: &${tclibc}-${kernel}
+ local_conf:
+ - INHERIT += 'buildstats buildstats-summary'
+ - INHERIT:remove = 'rm_work'
+ - TCLIBC := '${tclibc}'
+ - PREFERRED_PROVIDER_virtual/kernel := 'linux-${kernel}'
+ - INITRAMFS_IMAGE ?= 'initramfs-rootfs-image'
+
+ EOF
+ done
+ done
+
+ cat << EOF >> plan.yaml
+ jobs:
+ EOF
+
+ # FIXME: loop over kernels instead of hardcoding them, need to support armv7a and modem first
+ for tclibc in ${TCLIBC}; do
+ cat << EOF >> plan.yaml
+ - name: ${tclibc}
+ bakes:
+ EOF
+ for machine in ${{inputs.machines}}; do
+ cat << EOF >> plan.yaml
+ - { <<: [*commondata, *${tclibc}-linaro-qcomlt], machine: ${machine}, name: ${machine}-${tclibc} }
+ EOF
+ if [ "${machine}" = "qcom-armv8a" -a "${{inputs.branch}}" = "master" ] ; then
+ cat << EOF >> plan.yaml
+ - { <<: [*commondata, *${tclibc}-yocto], machine: qcom-armv8a, name: qcom-armv8a-${tclibc}-yocto }
+ EOF
+ fi
+ 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 }}