Skip to content

Commit e4003a8

Browse files
CI: rework jobs to lower number of API calls (#1629)
It is not infrequent for CI workflows to exhaust GitHub API token bucket. One of the main reasons is that most of testing jobs download all artifacts again and again. Rework testing actions and workflows to download only those artifacts which are required for the test.
2 parents 6899f55 + 1be1509 commit e4003a8

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

.github/actions/lava-test-plans/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ runs:
3838
with:
3939
github-token: ${{ inputs.gh_token }}
4040
run-id: ${{ inputs.build_id }}
41-
pattern: build-url_*
41+
name: build-url_${{ inputs.machine }}_${{ inputs.distro_name }}${{ inputs.kernel }}
4242

4343
- name: Run lava-test-plans
4444
shell: bash
@@ -71,7 +71,7 @@ runs:
7171
fi
7272
echo "IMAGE_FILE_NAME=${IMAGE_TYPE}-${{ inputs.machine }}.rootfs.qcomflash.tar.gz" >> "${VARS_OUT_PATH}/gh-variables.ini"
7373
export BUILD_URL=""
74-
export BUILD_URL_FILE="$GITHUB_WORKSPACE/build-url_${{ inputs.machine }}_${{ inputs.distro_name }}${{ inputs.kernel }}/build-url_${{ inputs.machine }}_${{ inputs.distro_name }}${{ inputs.kernel }}"
74+
export BUILD_URL_FILE="$GITHUB_WORKSPACE/build-url_${{ inputs.machine }}_${{ inputs.distro_name }}${{ inputs.kernel }}"
7575
echo "${BUILD_URL_FILE}"
7676
if [ -f "$BUILD_URL_FILE" ]; then
7777
export BUILD_URL=$(cat "${BUILD_URL_FILE}")

.github/actions/list-jobs/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ runs:
4646
F_TMP="${J#*/}"
4747
RESULT_NAME="${F_TMP//\//-}"
4848
echo $RESULT_NAME
49-
RESULT_JSON=$(echo "$RESULT_JSON" | jq -c --arg path "${J}" --arg result_file "${RESULT_NAME}" --arg name "${NAME}" '.target += [$ARGS.named]')
49+
RESULT_JSON=$(echo "$RESULT_JSON" | jq -c --arg path "${F_TMP#*/}" --arg artifact "${F_TMP%%/*}" --arg result_file "${RESULT_NAME}" --arg name "${NAME}" '.target += [$ARGS.named]')
5050
echo "$RESULT_JSON"
5151
done
5252
echo "$RESULT_JSON"

.github/workflows/test.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ jobs:
6363
with:
6464
fetch-depth: 0
6565

66-
- name: 'Download job templates'
67-
uses: actions/download-artifact@v7
68-
with:
69-
pattern: boottest-*
70-
7166
- name: "List jobs"
7267
id: listjobs
7368
uses: ./.github/actions/list-jobs
@@ -87,7 +82,7 @@ jobs:
8782
- name: 'Download job templates'
8883
uses: actions/download-artifact@v7
8984
with:
90-
pattern: boottest-*
85+
name: ${{ matrix.target.artifact }}
9186

9287
- name: Submit ${{ matrix.target.name }}
9388
timeout-minutes: 20
@@ -193,10 +188,6 @@ jobs:
193188
- uses: actions/checkout@v4
194189
with:
195190
fetch-depth: 0
196-
- name: 'Download job templates'
197-
uses: actions/download-artifact@v7
198-
with:
199-
pattern: premerge-*
200191

201192
- name: "List jobs"
202193
id: listjobs
@@ -217,7 +208,7 @@ jobs:
217208
- name: 'Download job templates'
218209
uses: actions/download-artifact@v7
219210
with:
220-
pattern: premerge-*
211+
name: ${{ matrix.target.artifact}}
221212

222213
- name: Submit ${{ matrix.target.name }}
223214
timeout-minutes: 20

0 commit comments

Comments
 (0)