|
| 1 | +name: Fastrpc lava Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +env: |
| 12 | + BASE_ARTIFACT_URL: https://quic-yocto-fileserver-1029608027416.us-central1.run.app/qualcomm-linux/meta-qcom-15010641606-1 |
| 13 | + |
| 14 | +jobs: |
| 15 | + prepare-job-list: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + outputs: |
| 18 | + jobmatrix: ${{ steps.listjobs.outputs.jobmatrix }} |
| 19 | + steps: |
| 20 | + - name: Clone fastrpc repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + repository: quic/fastrpc |
| 24 | + path: fastrpc |
| 25 | + fetch-depth: 0 |
| 26 | + |
| 27 | + - name: Clone meta-qcom repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + repository: qualcomm-linux/meta-qcom |
| 31 | + path: meta-qcom |
| 32 | + fetch-depth: 0 |
| 33 | + |
| 34 | + - name: Print trigger |
| 35 | + run: | |
| 36 | + echo "Triggered by ${{ github.event_name }}" |
| 37 | +
|
| 38 | + - name: "List jobs" |
| 39 | + id: listjobs |
| 40 | + run: | |
| 41 | + JOBFILES=$(find meta-qcom/ci/lava/ -name *.yaml) |
| 42 | + JOBFILES=$(echo "$JOBFILES" | sed -e "s/^/\"/" | sed -e "s/$/\",/" | tr -d "\n" | sed -e "s/.$//") |
| 43 | + JOBFILES="[${JOBFILES}]" |
| 44 | + J=$(jq -cn --argjson jobfiles "$JOBFILES" '{target: $jobfiles}') |
| 45 | + echo "jobmatrix=$J" >> $GITHUB_OUTPUT |
| 46 | + echo "Preparing test job files" |
| 47 | +
|
| 48 | + submit-job: |
| 49 | + needs: prepare-job-list |
| 50 | + runs-on: ubuntu-latest |
| 51 | + strategy: |
| 52 | + matrix: ${{ fromJson(needs.prepare-job-list.outputs.jobmatrix) }} |
| 53 | + steps: |
| 54 | + - name: Clone fastrpc repository |
| 55 | + uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + repository: quic/fastrpc |
| 58 | + path: fastrpc |
| 59 | + fetch-depth: 0 |
| 60 | + |
| 61 | + - name: Clone meta-qcom repository |
| 62 | + uses: actions/checkout@v4 |
| 63 | + with: |
| 64 | + repository: qualcomm-linux/meta-qcom |
| 65 | + path: meta-qcom |
| 66 | + fetch-depth: 0 |
| 67 | + |
| 68 | + - name: "Update test definition ${{ matrix.target }}" |
| 69 | + run: | |
| 70 | + TARGET=${{ matrix.target }} |
| 71 | + FIND_PATH="${TARGET#*/}" |
| 72 | + DEVICE_TYPE_PATH="${FIND_PATH%/*}" |
| 73 | + DEVICE_TYPE="${DEVICE_TYPE_PATH#*/}" |
| 74 | + DEVICE_TYPE=$(basename "$DEVICE_TYPE_PATH") |
| 75 | + BUILD_FILE_NAME="core-image-base-${DEVICE_TYPE}.rootfs.qcomflash.tar.gz" |
| 76 | + BUILD_DOWNLOAD_URL="${BASE_ARTIFACT_URL}/${DEVICE_TYPE}-${BUILD_FILE_NAME}" |
| 77 | + sed -i "s|{{DEVICE_TYPE}}|${DEVICE_TYPE}|g" "${{ matrix.target }}" |
| 78 | + sed -i "s|{{GITHUB_SHA}}|${GITHUB_SHA}|g" "${{ matrix.target }}" |
| 79 | + sed -i "s|{{BUILD_DOWNLOAD_URL}}|${BUILD_DOWNLOAD_URL}|g" "${{ matrix.target }}" |
| 80 | + sed -i "s|{{BUILD_FILE_NAME}}|${BUILD_FILE_NAME}|g" "${{ matrix.target }}" |
| 81 | + sed -i "s|{{GITHUB_RUN_ID}}|${GITHUB_RUN_ID}|g" "${{ matrix.target }}" |
| 82 | + cat "${{ matrix.target }}" |
| 83 | +
|
| 84 | + - name: Submit ${{ matrix.target }} |
| 85 | + timeout-minutes: 20 |
| 86 | + uses: foundriesio/lava-action@v6 |
| 87 | + with: |
| 88 | + lava_token: ${{ secrets.LAVATOKEN }} |
| 89 | + lava_url: 'lava.infra.foundries.io' |
| 90 | + job_definition: ${{ matrix.target }} |
| 91 | + wait_for_job: true |
| 92 | + fail_action_on_failure: false |
| 93 | + save_result_as_artifact: true |
| 94 | + save_job_details: true |
| 95 | + |
| 96 | + publish-test-results: |
| 97 | + name: "Publish Tests Results" |
| 98 | + needs: submit-job |
| 99 | + runs-on: ubuntu-latest |
| 100 | + permissions: |
| 101 | + checks: write |
| 102 | + pull-requests: write |
| 103 | + |
| 104 | + steps: |
| 105 | + - name: Download Artifacts |
| 106 | + uses: actions/download-artifact@v4 |
| 107 | + with: |
| 108 | + path: artifacts |
| 109 | + |
| 110 | + - name: "List files" |
| 111 | + run: | |
| 112 | + echo $GITHUB_WORKSPACE |
| 113 | + ls -R $GITHUB_WORKSPACE |
| 114 | +
|
| 115 | + - name: Publish Test Results |
| 116 | + uses: EnricoMi/publish-unit-test-result-action@v2 |
| 117 | + with: |
| 118 | + files: "${{ github.workspace }}/artifacts/**/*.xml" |
| 119 | + |
| 120 | + - name: Publish Test Job Details |
| 121 | + run: | |
| 122 | + for json_file in $(find ${{ github.workspace }} -name "test-job-*.json") |
| 123 | + do |
| 124 | + DEVICE_TYPE=$(cat "$json_file" | jq -r ".requested_device_type") |
| 125 | + URL=$(cat "$json_file" | jq -r ".url") |
| 126 | + JOB_ID=$(cat "$json_file" | jq -r ".id") |
| 127 | + echo " * [Job $JOB_ID on $EVICE_TYPE" |
| 128 | + echo " * [Job $JOB_ID on $DEVICETYPE" >> $GITHUB_STEP_SUMMARY |
| 129 | + done |
0 commit comments