From bc8f137dad74d3a14f0ddbbe603b121e14a99e59 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 29 Nov 2024 14:34:38 +0000 Subject: [PATCH] workflows: add boot testing to CI builds Signed-off-by: Milosz Wasilewski --- .github/workflows/build-yocto.yml | 38 ++++++++++++++++++++++ ci/lava/qcs6490-rb3gen2-core-kit.yml | 47 ++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 ci/lava/qcs6490-rb3gen2-core-kit.yml diff --git a/.github/workflows/build-yocto.yml b/.github/workflows/build-yocto.yml index c7772785..9d924cf5 100644 --- a/.github/workflows/build-yocto.yml +++ b/.github/workflows/build-yocto.yml @@ -115,3 +115,41 @@ jobs: (( retries == i )) && { echo 'Failed to publish artifacts'; exit 1; } echo Image available at: ${url} + boot-test: + needs: compile + if: github.repository == 'quic-yocto/meta-qcom-hwe' + strategy: + fail-fast: true + matrix: + machine: + - qcs6490-rb3gen2-core-kit + runs-on: [self-hosted, x86] + name: ${{ matrix.machine }}/lava + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create test job definition + id: create_definition + run: | + export DEVICE_TYPE=${{ matrix.machine }} + export BUILD_FILE_NAME="core-image-minimal-${DEVICE_TYPE}.rootfs.qcomflash.tar.gz" + export BUILD_DOWNLOAD_URL="https://quic-yocto-fileserver-1029608027416.us-central1.run.app/${GITHUB_RUN_ID}/${{ matrix.machine }}/${BUILD_FILE_NAME}" + + export JOB_FILE_NAME="${{ matrix.machine }}-${GITHUB_RUN_ID}.yml" + sed "s|{{GITHUB_RUN_ID}}|${GITHUB_RUN_ID}|g" ci/lava/${{ matrix.machine }}.yml > "${JOB_FILE_NAME}" + sed -i "s|{{GITHUB_SHA}}|${GITHUB_SHA}|g" "${JOB_FILE_NAME}" + sed -i "s|{{DEVICE_TYPE}}|${DEVICE_TYPE}|g" "${JOB_FILE_NAME}" + sed -i "s|{{BUILD_DOWNLOAD_URL}}|${BUILD_DOWNLOAD_URL}|g" "${JOB_FILE_NAME}" + sed -i "s|{{BUILD_FILE_NAME}}|${BUILD_FILE_NAME}|g" "${JOB_FILE_NAME}" + cat "${JOB_FILE_NAME}" + echo "job_file_name=${JOB_FILE_NAME}" >> "${GITHUB_OUTPUT}" + + - uses: foundriesio/lava-action@v1 + with: + lava_token: '${{ secrets.LavaToken }}' + lava_url: 'lava.infra.foundries.io' + job_definition: ${{ steps.create_definition.outputs.job_file_name }} + wait_for_job: 'true' + fail_action_on_failure: 'true' diff --git a/ci/lava/qcs6490-rb3gen2-core-kit.yml b/ci/lava/qcs6490-rb3gen2-core-kit.yml new file mode 100644 index 00000000..060f7e3c --- /dev/null +++ b/ci/lava/qcs6490-rb3gen2-core-kit.yml @@ -0,0 +1,47 @@ +actions: +- deploy: + images: + image: + headers: + Authentication: Q_GITHUB_TOKEN + url: "{{BUILD_DOWNLOAD_URL}}" + postprocess: + docker: + image: ghcr.io/foundriesio/lava-lmp-sign:main + steps: + - export IMAGE_PATH=$PWD + - echo "DEVICE_TYPE=qcs6490-rb3gen2" >> $IMAGE_PATH/flash.settings + - cat $IMAGE_PATH/flash.settings + timeout: + minutes: 10 + to: downloads +- deploy: + images: + image: + url: downloads://{{BUILD_FILE_NAME}} + settings: + url: downloads://flash.settings + timeout: + minutes: 10 + to: flasher +- boot: + auto_login: + login_prompt: 'login:' + password: root + method: minimal + - root@{{DEVICE_TYPE}} + timeout: + minutes: 10 +- command: + name: network_turn_on +device_type: {{DEVICE_TYPE}} +job_name: boot test ({{DEVICE_TYPE}}) {{GITHUB_RUN_ID}} +metadata: + build-commit: '{{GITHUB_SHA}}' +priority: 50 +tags: +- cambridge-lab +timeouts: + job: + minutes: 25 +visibility: public