From 517e84f4d80092b697b1040da84fbb52d2ff4500 Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Tue, 31 May 2022 14:14:58 +0200 Subject: [PATCH] .github: switch to TuxOE plans Use TuxOE plans to submit multiple jobs at once, instead of matrix build since it uses one Github Action job for each build. Signed-off-by: Nicolas Dechesne --- .github/workflows/build-template.yml | 103 ++++++++++++++------------- .github/workflows/premerge.yml | 3 +- .github/workflows/push.yml | 3 +- 3 files changed, 56 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build-template.yml b/.github/workflows/build-template.yml index 6a7b4b7..0191ef2 100644 --- a/.github/workflows/build-template.yml +++ b/.github/workflows/build-template.yml @@ -26,16 +26,12 @@ on: env: POKY_URL: http://git.yoctoproject.org/git/poky DISTRO: poky + TCLIBC: glibc musl jobs: - meta-qcom-premerge-build-test: - name: ${{ matrix.machine }}/${{ matrix.tclibc }} + build: + name: ${{github.event_name}} - ${{github.ref}} runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - machine: ${{ fromJson(inputs.machines) }} - tclibc: [glibc, musl] steps: - name: Set up Python uses: actions/setup-python@v3 @@ -44,51 +40,60 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade tuxsuite - - name: Setup tux definition - env: - MACHINE: ${{ matrix.machine }} - TCLIBC: ${{ matrix.tclibc }} - REF: ${{ inputs.ref }} - IMAGES: ${{ inputs.images }} - HOST: ${{ inputs.host }} - BRANCH: ${{ inputs.branch }} - URL: ${{ inputs.url }} + - name: Setup tux plan run: | - cat << EOF > tux.json - { - "sources": { - "git_trees": [ - { - "url": "$POKY_URL", - "branch": "$BRANCH" - }, - { - "url": "$URL", - "ref": "$REF" - } - ] - }, - "container": "$HOST", - "envsetup": "poky/oe-init-build-env", - "distro": "$DISTRO", - "machine": "$MACHINE", - "target": "$IMAGES", - "bblayers_conf": [ - "BBLAYERS += '../meta-qcom/'" - ], - "artifacts": [ - "\$DEPLOY_DIR" - ], - "environment": { - }, - "local_conf": [ - "INHERIT += 'buildstats buildstats-summary'", - "TCLIBC := '$TCLIBC'" - ] - } + 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 + - ref: ${{inputs.ref}} + url: ${{inputs.url}} + distro: $DISTRO + target: ${{inputs.images}} + bblayers_conf: + - BBLAYERS += '../meta-qcom/' + artifacts: + - \$DEPLOY_DIR EOF + + for tclibc in ${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 ${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 bake submit tux.json + tuxsuite plan plan.yaml env: TUXSUITE_TOKEN: ${{ secrets.TUXSUITE_TOKEN }} diff --git a/.github/workflows/premerge.yml b/.github/workflows/premerge.yml index 1304183..e8a8dcc 100644 --- a/.github/workflows/premerge.yml +++ b/.github/workflows/premerge.yml @@ -9,8 +9,7 @@ jobs: with: host: ubuntu-20.04 images: core-image-base core-image-weston core-image-x11 initramfs-test-image initramfs-test-full-image initramfs-firmware-image initramfs-rootfs-image cryptodev-module - machines: >- - ['dragonboard-410c', 'dragonboard-845c', 'qrb5165-rb5', 'qcom-armv8a', 'sdx55-mtp', 'sa8155p-adp', 'qcom-armv7a'] + machines: dragonboard-410c dragonboard-845c qrb5165-rb5 qcom-armv8a sdx55-mtp sa8155p-adp qcom-armv7a ref: refs/pull/${{github.event.pull_request.number}}/merge branch: ${{github.base_ref}} url: ${{github.server_url}}/${{github.repository}} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b732ff4..bda12de 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -13,8 +13,7 @@ jobs: with: host: ubuntu-20.04 images: core-image-base core-image-weston core-image-x11 initramfs-test-image initramfs-test-full-image initramfs-firmware-image initramfs-rootfs-image cryptodev-module - machines: >- - ['dragonboard-410c', 'dragonboard-845c', 'qrb5165-rb5', 'qcom-armv8a', 'sdx55-mtp', 'sa8155p-adp', 'qcom-armv7a'] + machines: dragonboard-410c dragonboard-845c qrb5165-rb5 qcom-armv8a sdx55-mtp sa8155p-adp qcom-armv7a ref: ${{github.sha}} branch: ${{github.ref_name}} url: ${{github.server_url}}/${{github.repository}}