Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/lava-schema-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ jobs:
BUILD_DOWNLOAD_URL="https://example.com/downloads/1"
GITHUB_SHA="7e6f96ccf3e911a8a1a18accdbb91991aa0db66e"

find ci/lava/ -name "*.yaml" -exec sed -i "s|{{DEVICE_TYPE}}|${DEVICE_TYPE}|g" '{}' \;
find ci/lava/ -name "*.yaml" -exec sed -i "s|{{GITHUB_SHA}}|${GITHUB_SHA}|g" '{}' \;
find ci/lava/ -name "*.yaml" -exec sed -i "s|{{BUILD_DOWNLOAD_URL}}|${BUILD_DOWNLOAD_URL}|g" '{}' \;
find ci/lava/ -name "*.yaml" -exec sed -i "s|{{BUILD_FILE_NAME}}|${BUILD_FILE_NAME}|g" '{}' \;
find ci/lava/ -name "*.yaml" -exec sed -i "s|{{GITHUB_RUN_ID}}|${GITHUB_RUN_ID}|g" '{}' \;
find ci/lava/ -name "*.yaml" -exec sed \
-e "s|{{BUILD_DOWNLOAD_URL}}|${BUILD_DOWNLOAD_URL}|g" \
-e "s|{{BUILD_FILE_NAME}}|${BUILD_FILE_NAME}|g" \
-e "s|{{DEVICE_TYPE}}|${DEVICE_TYPE}|g" \
-e "s|{{GITHUB_REPOSITORY}}|${GITHUB_REPOSITORY}|g" \
-e "s|{{GITHUB_RUN_ATTEMPT}}|${GITHUB_RUN_ATTEMPT}|g" \
-e "s|{{GITHUB_RUN_ID}}|${GITHUB_RUN_ID}|g" \
-e "s|{{GITHUB_SHA}}|${GITHUB_SHA}|g" \
-i '{}' \;

python3 ci/schemacheck.py ./ci/lava/
ci/schemacheck.py ci/lava/
41 changes: 27 additions & 14 deletions .github/workflows/lava-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ permissions:

env:
BUILD_URL: ${{ inputs.url }}
LAVA_CI: ci/lava/

jobs:
prepare-job-list:
Expand All @@ -34,10 +35,15 @@ jobs:
- name: "List jobs"
id: listjobs
run: |
JOBFILES=$(find ci/lava/ -name *.yaml)
JOBFILES=$(echo "$JOBFILES" | sed -e "s/^/\"/" | sed -e "s/$/\",/" | tr -d "\n" | sed -e "s/.$//")
JOBFILES="[${JOBFILES}]"
J=$(jq -cn --argjson jobfiles "$JOBFILES" '{target: $jobfiles}')
# json with list of relative filenames to LAVA templates
J=$(find "${LAVA_CI}" -name '*.yaml' -print0 |
jq -Rs '
# split null-delimited list and remove last empty item
split("\u0000")[:-1]
# remove leading "ci/lava/"
| map(sub("^ci/lava/"; ""))
| {target: .}
')
echo "jobmatrix=$J" >> $GITHUB_OUTPUT
echo "Preparing testjob files"

Expand All @@ -55,24 +61,31 @@ jobs:

- name: "Update test definition ${{ matrix.target }}"
run: |
TARGET=${{ matrix.target }}
FIND_PATH="${TARGET#*/}"
DEVICE_TYPE_PATH="${FIND_PATH%/*}"
DEVICE_TYPE="${DEVICE_TYPE_PATH#*/}"
# e.g. qrb2210-rb1/boot.yaml
TARGET="${{ matrix.target }}"
TEMPLATE="${LAVA_CI}${TARGET}"
# left-side – e.g. qrb2210-rb1
DEVICE_TYPE="${TARGET%/*}"
BUILD_DOWNLOAD_URL="$BUILD_URL"
sed -i "s|{{DEVICE_TYPE}}|${DEVICE_TYPE}|g" "${{ matrix.target }}"
sed -i "s|{{GITHUB_SHA}}|${GITHUB_SHA}|g" "${{ matrix.target }}"
sed -i "s|{{BUILD_DOWNLOAD_URL}}|${BUILD_DOWNLOAD_URL}|g" "${{ matrix.target }}"
sed -i "s|{{GITHUB_RUN_ID}}|${GITHUB_RUN_ID}|g" "${{ matrix.target }}"
cat "${{ matrix.target }}"
BUILD_FILE_NAME="unused"
sed \
-e "s|{{BUILD_DOWNLOAD_URL}}|${BUILD_DOWNLOAD_URL}|g" \
-e "s|{{BUILD_FILE_NAME}}|${BUILD_FILE_NAME}|g" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is required. The whole section will be replaced with a templating tool.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable isn't used, but I'm trying to keep the same set in both workflows

(Of course I'm super happy to drop all of this once we have a LAVA templating system in place!)

-e "s|{{DEVICE_TYPE}}|${DEVICE_TYPE}|g" \
-e "s|{{GITHUB_REPOSITORY}}|${GITHUB_REPOSITORY}|g" \
-e "s|{{GITHUB_RUN_ATTEMPT}}|${GITHUB_RUN_ATTEMPT}|g" \
-e "s|{{GITHUB_RUN_ID}}|${GITHUB_RUN_ID}|g" \
-e "s|{{GITHUB_SHA}}|${GITHUB_SHA}|g" \
-i "$TEMPLATE"
cat "$TEMPLATE"

- name: Submit ${{ matrix.target }}
timeout-minutes: 240
uses: foundriesio/lava-action@v6
with:
lava_token: ${{ secrets.LAVATOKEN }}
lava_url: 'lava.infra.foundries.io'
job_definition: ${{ matrix.target }}
job_definition: ${{ env.LAVA_CI }}${{ matrix.target }}
wait_for_job: true
fail_action_on_failure: false
save_result_as_artifact: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ context:
lava_test_results_dir: /home/lava-%s
test_character_delay: 10
device_type: qcs6490
job_name: boot test (rb3gen2) {{GITHUB_RUN_ID}}
job_name: smoke tests {{GITHUB_REPOSITORY}} {{GITHUB_RUN_ID}}-{{GITHUB_RUN_ATTEMPT}}
metadata:
build-commit: '{{GITHUB_SHA}}'
priority: 50
Expand Down
2 changes: 1 addition & 1 deletion ci/lava/qrb2210-rb1/boot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ context:
lava_test_results_dir: /home/lava-%s
test_character_delay: 10
device_type: qrb2210-rb1
job_name: boot test (rb1) {{GITHUB_RUN_ID}}
job_name: smoke tests {{GITHUB_REPOSITORY}} {{GITHUB_RUN_ID}}-{{GITHUB_RUN_ATTEMPT}}
metadata:
build-commit: '{{GITHUB_SHA}}'
priority: 50
Expand Down
1 change: 1 addition & 0 deletions ci/schemacheck.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: MIT

Expand Down
Loading