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 43e29c3
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build-yocto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,46 @@ 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
run: |
ls -a ci/
ls -a ci/lava/
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"
echo "${DEVICE_TYPE}"
echo "${BUILD_FILE_NAME}"
echo "${BUILD_DOWNLOAD_URL}"
echo "${GITHUB_RUN_ID}"
echo "${JOB_FILENAME}"
sed "s/{{GITHUB_RUN_ID}}/${GITHUB_RUN_ID}/g" ci/lava/${{ matrix.machine }}.yml > "${JOB_FILENAME}"
sed -i "s/{{GITHUB_SHA}}/${GITHUB_SHA}/g" "${JOB_FILENAME}"
sed -i "s/{{DEVICE_TYPE}}/${DEVICE_TYPE}/g" "${JOB_FILENAME}"
sed -i "s/{{BUILD_DOWNLOAD_URL}}/${BUILD_DOWNLOAD_URL}/g" "${JOB_FILENAME}"
sed -i "s/{{BUILD_FILE_NAME}}/${BUILD_FILE_NAME}/g" "${JOB_FILENAME}"
cat "${JOB_FILENAME}"
- uses: foundriesio/lava-action@v1
with:
lava_token: '${{ secrets.LavaToken }}'
lava_url: 'lava.infra.foundries.io'
job_definition: '${{ matrix.machine }}-${GITHUB_RUN_ID}.yml'
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 43e29c3

Please sign in to comment.