Skip to content

Commit

Permalink
workflows: add boot testing to CI builds
Browse files Browse the repository at this point in the history
Signed-off-by: Milosz Wasilewski <[email protected]>
  • Loading branch information
mwasilew committed Dec 2, 2024
1 parent 6a394cf commit bc8f137
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-yocto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
47 changes: 47 additions & 0 deletions ci/lava/qcs6490-rb3gen2-core-kit.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bc8f137

Please sign in to comment.