-
Notifications
You must be signed in to change notification settings - Fork 172
Workflows/lava test plans #1312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sbanerjee-quic
merged 4 commits into
qualcomm-linux:master
from
mwasilew:workflows/lava-test-plans
Jan 5, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
dae44ec
workflows: move LAVA job generation to lava-test-plans
mwasilew 07d3b92
workflows: add pre-merge test plan for meta-qcom
mwasilew 3962ae9
workflows: lava-test-plans: Save files to separate dirs
mwasilew b733e30
workflows: Pin python version in lava-test-plans
mwasilew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: Run lava-test-plans | ||
| inputs: | ||
| machine: | ||
| required: true | ||
| distro_name: | ||
| required: true | ||
| build_id: | ||
| description: "ID of the workflow from which build URL will be downloaded" | ||
| required: true | ||
| gh_token: | ||
| description: "Github token. It's required to download artifacts from the workflow" | ||
| required: true | ||
| prefix: | ||
| description: "Prefix for the compressed file that is uploaded as workflow artifact" | ||
| default: testjobs | ||
| testplan: | ||
| description: "Name of the test plan to use in job generation" | ||
| default: boot | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| repository: qualcomm-linux/lava-test-plans | ||
| path: lava-test-plans | ||
| ref: cdb8221de2a8f78533ef6b812fc4f5a2461c5525 | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: 3.11 | ||
|
|
||
| - name: 'Download build URLs' | ||
| uses: actions/download-artifact@v6 | ||
| with: | ||
| github-token: ${{ inputs.gh_token }} | ||
| run-id: ${{ inputs.build_id }} | ||
| pattern: build-url_* | ||
|
|
||
| - name: Run lava-test-plans | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| cd lava-test-plans && pip install . | ||
mwasilew marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| lava-test-plans --version | ||
| OUT_PATH="${GITHUB_WORKSPACE}/out" | ||
| VARS_OUT_PATH="${OUT_PATH}/vars" | ||
| JOBS_OUT_PATH="${OUT_PATH}/jobs" | ||
| echo "JOBS_OUT_PATH=${JOBS_OUT_PATH}" >> $GITHUB_ENV | ||
| mkdir -p "${VARS_OUT_PATH}" | ||
| mkdir -p "${JOBS_OUT_PATH}" | ||
| echo "PROJECT_NAME=${GITHUB_REPOSITORY#*/}" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "PROJECT=projects/${GITHUB_REPOSITORY#*/}/" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "LAVA_JOB_PRIORITY=50" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "OS_INFO=qcom-distro" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
sbanerjee-quic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "BUILD_NUMBER=${{ github.run_id }}-${{ github.run_attempt }}" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "DOCKER_IMAGE_POSTPROCESS=ghcr.io/foundriesio/lava-lmp-sign:main" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "AUTH_HEADER_NAME=Authentication" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "AUTH_HEADER_TOKEN=Q_GITHUB_TOKEN" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "TEST_DEFINITIONS_REPOSITORY=https://github.com/qualcomm-linux/qcom-linux-testkit/" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "FLASHER_DEVICE_TYPE=qcs" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| IMAGE_TYPE="core-image-base" | ||
| if [ "${{ inputs.distro_name }}" = "qcom-distro" ]; then | ||
| IMAGE_TYPE="qcom-multimedia-image" | ||
| echo "AUTO_LOGIN_PASSWORD_PROMPT=Password" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| echo "AUTO_LOGIN_PASSWORD=oelinux123" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| fi | ||
| echo "IMAGE_FILE_NAME=${IMAGE_TYPE}-${{ inputs.machine }}.rootfs.qcomflash.tar.gz" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| export BUILD_URL="" | ||
| export BUILD_URL_FILE="$GITHUB_WORKSPACE/build-url_${{ inputs.machine }}_${{ inputs.distro_name }}/build-url_${{ inputs.machine }}_${{ inputs.distro_name }}" | ||
sbanerjee-quic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "${BUILD_URL_FILE}" | ||
| if [ -f "$BUILD_URL_FILE" ]; then | ||
| export BUILD_URL=$(cat "${BUILD_URL_FILE}") | ||
| fi | ||
| if [ -z "${BUILD_URL}" ]; then | ||
| echo "BUILD_URL missing" | ||
| # fail action if BUILD_URL is empty. At this point the variable should be filled in | ||
| exit 1 | ||
| fi | ||
| echo "BUILD_DOWNLOAD_URL=${BUILD_URL}/" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
|
|
||
| echo "ROOTFS_URL=${BUILD_URL}/${{ inputs.distro_name }}/${{ inputs.machine }}/${IMAGE_TYPE}-${{ inputs.machine }}.rootfs.qcomflash.tar.gz" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
sbanerjee-quic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if [ "${{ inputs.machine }}" = "qcom-armv8a" ]; then | ||
| echo "ROOTFS_IMG_FILE=core-image-base-qcom-armv8a.rootfs.ext4" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
| cp "${VARS_OUT_PATH}/gh-variables.ini" dragonboard-410c.ini | ||
| echo "DEVICE_TYPE=dragonboard-410c" >> dragonboard-410c.ini | ||
| echo "BOOT_IMG_FILE=boot-apq8016-sbc-qcom-armv8a.img" >> dragonboard-410c.ini | ||
| cat dragonboard-410c.ini | ||
| lava-test-plans --dry-run --variables dragonboard-410c.ini --test-plan "${GITHUB_REPOSITORY#*/}/${{ inputs.distro_name }}/${{ inputs.testplan }}" --device-type "dragonboard-410c" --dry-run-path "${JOBS_OUT_PATH}/dragonboard-410c-${{ inputs.distro_name }}-${{ inputs.testplan }}" || true | ||
sbanerjee-quic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| cp "${VARS_OUT_PATH}/gh-variables.ini" dragonboard-820c.ini | ||
| echo "BOOT_IMG_FILE=boot-apq8096-db820c-qcom-armv8a.img" >> dragonboard-820c.ini | ||
| echo "DEVICE_TYPE=dragonboard-820c" >> dragonboard-820c.ini | ||
| cat dragonboard-820c.ini | ||
| lava-test-plans --dry-run --variables dragonboard-820c.ini --test-plan "${GITHUB_REPOSITORY#*/}/${{ inputs.distro_name }}/${{ inputs.testplan }}" --device-type "dragonboard-820c" --dry-run-path "${JOBS_OUT_PATH}/dragonboard-820c-${{ inputs.distro_name }}-${{ inputs.testplan }}" || true | ||
| echo "MACHINE=dragonboard" >> $GITHUB_ENV | ||
| else | ||
| echo "DEVICE_TYPE=${{ inputs.machine }}" >> "${VARS_OUT_PATH}/gh-variables.ini" | ||
|
|
||
| cat "${VARS_OUT_PATH}/gh-variables.ini" | ||
| lava-test-plans --dry-run --variables "${VARS_OUT_PATH}/gh-variables.ini" --test-plan "${GITHUB_REPOSITORY#*/}/${{ inputs.distro_name }}/${{ inputs.testplan }}" --device-type "${{ inputs.machine }}" --dry-run-path "${JOBS_OUT_PATH}/${{ inputs.machine }}-${{ inputs.distro_name }}-${{ inputs.testplan }}" || true | ||
| echo "MACHINE=${{ inputs.machine }}" >> $GITHUB_ENV | ||
| fi | ||
|
|
||
| - name: "List files" | ||
| shell: bash | ||
| run: | | ||
| echo "${GITHUB_WORKSPACE}" | ||
| ls -R "${GITHUB_WORKSPACE}" | ||
sbanerjee-quic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: 'Upload test jobs' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.prefix }}-${{ inputs.machine }}-${{ inputs.distro_name }} | ||
| path: ${{ env.JOBS_OUT_PATH }}/** | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: List LAVA test jobs for subsequent steps | ||
| inputs: | ||
| prefix: | ||
| description: Test job name prefix. Will be used for searching .yaml files | ||
| required: true | ||
| build_id: | ||
| description: "ID of the workflow from which build URL will be downloaded" | ||
| required: true | ||
| gh_token: | ||
| description: "Github token. It's required to download artifacts from the workflow" | ||
| required: true | ||
|
|
||
| outputs: | ||
| jobmatrix: | ||
| description: Job matrix composed from downloaded LAVA test job files | ||
| value: ${{ steps.listjobs.outputs.jobmatrix }} | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: 'Download build URLs' | ||
| uses: actions/download-artifact@v6 | ||
| with: | ||
| github-token: ${{ inputs.gh_token }} | ||
| run-id: ${{ inputs.build_id }} | ||
| pattern: ${{ inputs.prefix }}* | ||
|
|
||
| - name: "List files" | ||
| shell: bash | ||
| run: | | ||
| echo $GITHUB_WORKSPACE | ||
| ls -R $GITHUB_WORKSPACE | ||
|
|
||
| - name: "List jobs" | ||
| id: listjobs | ||
| shell: bash | ||
| run: | | ||
| JOBFILES=$(find . -name "*.yaml" | grep "${{ inputs.prefix }}") | ||
sbanerjee-quic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| RESULT_JSON=$(jq -n '{target: []}') | ||
| for J in $JOBFILES | ||
| do | ||
| echo $J | ||
| NAME=$(echo "$J" | cut --delimiter "/" --field 3) | ||
vkraleti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo $NAME | ||
| F_TMP="${J#*/}" | ||
| RESULT_NAME="${F_TMP//\//-}" | ||
| echo $RESULT_NAME | ||
| RESULT_JSON=$(echo "$RESULT_JSON" | jq -c --arg path "${J}" --arg result_file "${RESULT_NAME}" --arg name "${NAME}" '.target += [$ARGS.named]') | ||
| echo "$RESULT_JSON" | ||
| done | ||
| echo "$RESULT_JSON" | ||
|
|
||
| echo "jobmatrix=$RESULT_JSON" >> $GITHUB_OUTPUT | ||
| echo "Preparing testjob files" | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.