Skip to content

Commit d09a54c

Browse files
Allows to run icon checks based on matrix (quicker)
1 parent 13250ff commit d09a54c

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

.github/workflows/_check_icons.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@ on:
2121
description: 'The name of the artifact containing the built manifest'
2222
required: true
2323
type: string
24+
run_for_devices:
25+
description: 'The list of device(s) on which the checking will run'
26+
required: true
27+
type: string
2428

2529
jobs:
2630
check_icons:
2731
name: Check icons
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
device: ${{ fromJSON(inputs.run_for_devices) }}
2836
runs-on: ubuntu-22.04
2937

3038
steps:
@@ -50,5 +58,5 @@ jobs:
5058

5159
- name: Run script
5260
run: |
53-
./ledger-app-workflows/scripts/check_all.sh -c icons \
61+
./ledger-app-workflows/scripts/check_all.sh -c icons -t ${{ matrix.device }} \
5462
-a ./app-repository -m ${{ inputs.download_manifest_artifact_name }}

.github/workflows/reusable_guidelines_enforcer.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ jobs:
6060

6161
call_check_icons:
6262
name: Dispatch check
63-
needs: [call_get_workflow_version, call_get_app_manifest]
63+
needs: [call_get_app_metadata, call_get_workflow_version, call_get_app_manifest]
6464
uses: ./.github/workflows/_check_icons.yml
6565
with:
6666
app-repository: ${{ inputs.app_repository }}
6767
download_manifest_artifact_name: manifests
6868
ledger-app-workflows_ref: ${{ needs.call_get_workflow_version.outputs.version }}
69+
run_for_devices: ${{ needs.call_get_app_metadata.outputs.compatible_devices }}
6970

7071
call_check_app_load_params:
7172
name: Dispatch check

scripts/check_all.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ call_step() {
198198
fi
199199
;;
200200
"icons")
201-
COMMAND="${dirName}/check_icons.sh ${APP_DIR} ${REPO_NAME} ${MANIFEST_DIR}"
201+
COMMAND="${dirName}/check_icons.sh ${APP_DIR} ${REPO_NAME} ${MANIFEST_DIR} ${TARGET}"
202202
;;
203203
"app_load_params")
204204
COMMAND="python3 ${DATABASE_DIR}/scripts/app_load_params_check.py --database_path ${DATABASE_DIR}/app-load-params-db.json --app_manifests_path ${MANIFEST_DIR}"
205205
;;
206206
"makefile")
207-
COMMAND="${dirName}/check_makefile.sh ${APP_DIR} ${REPO_NAME} ${MANIFEST_DIR}"
207+
COMMAND="${dirName}/check_makefile.sh ${APP_DIR} ${REPO_NAME} ${MANIFEST_DIR} ${TARGET}"
208208
;;
209209
"readme")
210210
COMMAND="${dirName}/check_readme.sh ${APP_DIR} ${REPO_NAME}"

scripts/check_icons.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,17 @@ main() (
155155
repo="$1"
156156
repo_name="$2"
157157
manifests_dir="$3"
158+
target="$4"
158159

159160
all_glyph_files=""
160161
declare -A icons_and_devices
161162

162163
# Parse all manifest files
163-
manifests_list=$(find "$manifests_dir" -type f -name "*.json")
164+
if [[ -n "${target}" ]]; then
165+
manifests_list="manifest_${target}.json"
166+
else
167+
manifests_list=$(find "$manifests_dir" -type f -name "*.json")
168+
fi
164169
while IFS= read -r manifest; do
165170
log_info "Checking manifest $manifest"
166171

scripts/check_makefile.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ main() (
1010
repo="$1"
1111
repo_name="$2"
1212
manifests_dir="$3"
13+
target="$4"
1314

1415
declare -A variants_array
1516
declare -A appnames_array
@@ -22,7 +23,11 @@ main() (
2223
fi
2324

2425
# Parse all manifest files
25-
manifests_list=$(find "$manifests_dir" -type f -name "*.json")
26+
if [[ -n "${target}" ]]; then
27+
manifests_list="manifest_${target}.json"
28+
else
29+
manifests_list=$(find "$manifests_dir" -type f -name "*.json")
30+
fi
2631
while IFS= read -r manifest; do
2732
log_info "Checking manifest $manifest"
2833

0 commit comments

Comments
 (0)