1212 PYTHONUNBUFFERED : " 1"
1313 PYTEST_ADDOPTS : " --color=yes"
1414 LG_CONSOLE : " internal"
15- LG_FEATURE_APK : " true"
1615
1716concurrency :
1817 group : ${{ github.workflow }}-${{ github.ref }}
4241 oldstable_branch=$(echo "$oldstable_version" | cut -d. -f1,2)
4342
4443 versions="[
45- {\"type\": \"snapshot\", \"name\": \"snapshot\", \"url_base \": \"https://mirror-03.infra.openwrt.org/snapshots/targets\"},
46- {\"type\": \"stable\", \"name\": \"$stable_branch\", \"version\": \"$stable_version\", \"url_base \": \"https://mirror-03.infra.openwrt.org/releases/$stable_branch-SNAPSHOT/targets\"},
47- {\"type\": \"stable\", \"name\": \"$oldstable_branch\", \"version\": \"$oldstable_version\", \"url_base \": \"https://mirror-03.infra.openwrt.org/releases/$oldstable_branch-SNAPSHOT/targets\"}
44+ {\"type\": \"snapshot\", \"name\": \"snapshot\", \"version_url \": \"https://mirror-03.infra.openwrt.org/snapshots/targets\"},
45+ {\"type\": \"stable\", \"name\": \"$stable_branch\", \"version\": \"$stable_version\", \"version_url \": \"https://mirror-03.infra.openwrt.org/releases/$stable_branch-SNAPSHOT/targets\"},
46+ {\"type\": \"stable\", \"name\": \"$oldstable_branch\", \"version\": \"$oldstable_version\", \"version_url \": \"https://mirror-03.infra.openwrt.org/releases/$oldstable_branch-SNAPSHOT/targets\"}
4847 ]"
4948
5049 device_matrix=$(yq -o=json '
7271
7372 # Combine devices with versions to create full matrix
7473 matrix=$(echo "$device_matrix" | jq --argjson versions "$versions" '
75- [.[] as $device | $versions[] as $version | $device + {"version ": $version, "version_name": $version.name}]
74+ [.[] as $device | $versions[] as $version | $device + {"version_url ": $version.version_url , "version_name": $version.name}]
7675 ')
7776 echo "matrix=$(echo "$matrix" | jq -c '.')" >> $GITHUB_ENV
7877
8382 {"target": "armsr-armv8", "firmware": "generic-initramfs-kernel.bin", "dependency": "qemu-system-aarch64"}
8483 ]'
8584 qemu_matrix=$(echo "$qemu_base" | jq --argjson versions "$versions" '
86- [.[] as $qemu | $versions[] as $version | $qemu + {"version ": $version, "version_name": $version.name}]
85+ [.[] as $qemu | $versions[] as $version | $qemu + {"version_url ": $version.version_url , "version_name": $version.name}]
8786 ')
88- echo "qemu-matrix =$(echo "$qemu_matrix" | jq -c '.')" >> $GITHUB_ENV
87+ echo "qemu_matrix =$(echo "$qemu_matrix" | jq -c '.')" >> $GITHUB_ENV
8988
9089 - name : Filter out devices with open healthcheck issues
9190 id : set-matrix
@@ -104,9 +103,13 @@ jobs:
104103 ')
105104
106105 deduplicated_matrix=$(echo "$filtered_matrix" | jq '
107- group_by(.device) | map(.[0])
106+ group_by(.device,.version_name ) | map(.[0])
108107 ')
109108
109+ echo "matrix=$matrix"
110+ echo "deduplicated_matrix=$deduplicated_matrix"
111+ echo "qemu_matrix=$qemu_matrix"
112+
110113 echo "matrix=$(echo "$deduplicated_matrix" | jq -c '.')" >> $GITHUB_OUTPUT
111114 echo "qemu-matrix=$(echo "$qemu_matrix" | jq -c '.')" >> $GITHUB_OUTPUT
112115
@@ -129,16 +132,15 @@ jobs:
129132 - name : Set environment
130133 env :
131134 target : ${{ matrix.target }}
132- version_type : ${{ matrix.version.type }}
133- version_name : ${{ matrix.version.name }}
134- url_base : ${{ matrix.version.url_base }}
135+ VERSION_NAME : ${{ matrix.version_name }}
136+ UPSTREAM_URL : ${{ matrix.version_url }}
135137 run : |
136- echo "VERSION_NAME=$version_name" >> $GITHUB_ENV
138+ if [ "$VERSION_NAME" = "snapshot" ]; then
139+ # Define labgrid features
140+ echo "LG_FEATURE_APK=true" >> $GITHUB_ENV
137141
138- if [ "$version_type" = "snapshot" ]; then
139142 # Snapshot logic (existing)
140143 export firmware=openwrt-${{ matrix.target }}-${{ matrix.device }}-${{ matrix.firmware }}
141- UPSTREAM_URL="$url_base"
142144
143145 mkdir -p /tmp/tftp/${{ matrix.device }}
144146 wget $UPSTREAM_URL/${target/-/\/}/$firmware \
@@ -150,7 +152,6 @@ jobs:
150152 echo "LG_IMAGE=/tmp/tftp/${{ matrix.device }}/${firmware/.gz/}" >> $GITHUB_ENV
151153 else
152154 # Stable release logic
153- UPSTREAM_URL="$url_base"
154155
155156 # Fetch profiles.json to get real firmware filename
156157 profiles_url="$UPSTREAM_URL/${target/-/\/}/profiles.json"
@@ -212,7 +213,7 @@ jobs:
212213 --output-document /tmp/tftp/${{ matrix.device }}/$firmware_filename
213214 (cd /tmp/tftp/ && gzip -df ${{ matrix.device }}/$firmware_filename) || true
214215
215- FIRMWARE_VERSION=$(echo "$profiles_json" | jq -r '.version_number ')
216+ FIRMWARE_VERSION=$(echo "$profiles_json" | jq -r '.version_code ')
216217 echo "FIRMWARE_VERSION=$FIRMWARE_VERSION" >> $GITHUB_ENV
217218 echo "LG_IMAGE=/tmp/tftp/${{ matrix.device }}/${firmware_filename/.gz/}" >> $GITHUB_ENV
218219 fi
@@ -229,10 +230,10 @@ jobs:
229230
230231 - name : Run test
231232 run : |
232- mkdir -p ${{ matrix.device }}-${{ matrix.version.name }}/
233+ mkdir -p ${{ matrix.device }}-${{ matrix.version_name }}/
233234 uv run pytest tests/ \
234- --lg-log ${{ matrix.device }}-${{ matrix.version.name }}/ \
235- --junitxml=${{ matrix.device }}-${{ matrix.version.name }}/report.xml \
235+ --lg-log ${{ matrix.device }}-${{ matrix.version_name }}/ \
236+ --junitxml=${{ matrix.device }}-${{ matrix.version_name }}/report.xml \
236237 --lg-colored-steps \
237238 --log-cli-level=CONSOLE
238239
@@ -246,8 +247,8 @@ jobs:
246247 uses : actions/upload-artifact@v4
247248 if : always()
248249 with :
249- name : results-${{ matrix.device }}-${{ matrix.version.name }}
250- path : ${{ matrix.device }}-${{ matrix.version.name }}/*
250+ name : results-${{ matrix.device }}-${{ matrix.version_name }}
251+ path : ${{ matrix.device }}-${{ matrix.version_name }}/*
251252
252253 test-qemu :
253254 name : ${{ matrix.target }} (${{ matrix.version_name }})
@@ -272,27 +273,29 @@ jobs:
272273 ${{ matrix.dependency }}
273274
274275 echo "LG_ENV=targets/qemu-${{ matrix.target }}.yaml" >> $GITHUB_ENV
275- echo "VERSION_NAME=${{ matrix.version.name }}" >> $GITHUB_ENV
276+ echo "VERSION_NAME=${{ matrix.version_name }}" >> $GITHUB_ENV
276277
277278 - name : Install uv
278279 uses : astral-sh/setup-uv@v6
279280
280281 - name : Download test firmware
281282 env :
282283 target : ${{ matrix.target }}
283- version_type : ${{ matrix.version.type }}
284- version_name : ${{ matrix.version.name }}
285- url_base : ${{ matrix.version.url_base }}
284+ VERSION_NAME : ${{ matrix.version_name }}
285+ UPSTREAM_URL : ${{ matrix.version_url }}
286286 run : |
287- if [ "$version_type" = "snapshot" ]; then
287+ if [ "$VERSION_NAME" = "snapshot" ]; then
288+ # Define labgrid features
289+ echo "LG_FEATURE_APK=true" >> $GITHUB_ENV
290+
288291 # Snapshot logic
289292 firmware_name="openwrt-$target-${{ matrix.firmware }}"
290- wget "$url_base /${target/-/\/}/$firmware_name" \
293+ wget "$UPSTREAM_URL /${target/-/\/}/$firmware_name" \
291294 --output-document "$firmware_name"
292- FIRMWARE_VERSION=$(curl "$url_base /${target/-/\/}/version.buildinfo")
295+ FIRMWARE_VERSION=$(curl "$UPSTREAM_URL /${target/-/\/}/version.buildinfo")
293296 else
294297 # Stable release logic
295- profiles_url="$url_base /${target/-/\/}/profiles.json"
298+ profiles_url="$UPSTREAM_URL /${target/-/\/}/profiles.json"
296299 profiles_json=$(curl -s "$profiles_url")
297300
298301 # Find the appropriate image for QEMU
@@ -336,9 +339,9 @@ jobs:
336339 fi
337340
338341 echo "Using firmware: $firmware_name"
339- wget "$url_base /${target/-/\/}/$firmware_name" \
342+ wget "$UPSTREAM_URL /${target/-/\/}/$firmware_name" \
340343 --output-document "$firmware_name"
341- FIRMWARE_VERSION=$(echo "$profiles_json" | jq -r '.version_number ')
344+ FIRMWARE_VERSION=$(echo "$profiles_json" | jq -r '.version_code ')
342345 fi
343346
344347 echo "FIRMWARE_VERSION=$FIRMWARE_VERSION" >> $GITHUB_ENV
@@ -349,11 +352,11 @@ jobs:
349352 gunzip $FIRMWARE_FILE || true
350353 firmware_file=${FIRMWARE_FILE/.gz/}
351354
352- mkdir -p ${{ matrix.target }}-${{ matrix.version.name }}
355+ mkdir -p ${{ matrix.target }}-${{ matrix.version_name }}
353356
354357 uv run pytest tests/ \
355- --lg-log ${{ matrix.target }}-${{ matrix.version.name }}/ \
356- --junitxml=${{ matrix.target }}-${{ matrix.version.name }}/report.xml \
358+ --lg-log ${{ matrix.target }}-${{ matrix.version_name }}/ \
359+ --junitxml=${{ matrix.target }}-${{ matrix.version_name }}/report.xml \
357360 --lg-colored-steps \
358361 --log-cli-level=CONSOLE \
359362 --firmware $GITHUB_WORKSPACE/$firmware_file
@@ -362,8 +365,8 @@ jobs:
362365 uses : actions/upload-artifact@v4
363366 if : always()
364367 with :
365- name : results-qemu_${{ matrix.target }}-${{ matrix.version.name }}
366- path : ${{ matrix.target }}-${{ matrix.version.name }}/*
368+ name : results-qemu_${{ matrix.target }}-${{ matrix.version_name }}
369+ path : ${{ matrix.target }}-${{ matrix.version_name }}/*
367370
368371 results :
369372 name : Deploy results page
@@ -456,7 +459,7 @@ jobs:
456459 "version_name": "snapshot",
457460 "version_title": "Development Snapshots",
458461 "description": "Latest development builds",
459- "url_base ": "https://mirror-03.infra.openwrt.org/snapshots/targets",
462+ "version_url ": "https://mirror-03.infra.openwrt.org/snapshots/targets",
460463 "generated_at": "$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")"
461464 }
462465 EOF
@@ -467,7 +470,7 @@ jobs:
467470 "version_name": "$stable_branch",
468471 "version_title": "Current Stable Release",
469472 "description": "Daily rebuilds of current stable release ($stable_branch)",
470- "url_base ": "https://mirror-03.infra.openwrt.org/releases/$stable_branch-SNAPSHOT/targets",
473+ "version_url ": "https://mirror-03.infra.openwrt.org/releases/$stable_branch-SNAPSHOT/targets",
471474 "generated_at": "$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")"
472475 }
473476 EOF
@@ -478,7 +481,7 @@ jobs:
478481 "version_name": "$oldstable_branch",
479482 "version_title": "Previous Stable Release",
480483 "description": "Daily rebuilds of previous stable release ($oldstable_branch)",
481- "url_base ": "https://mirror-03.infra.openwrt.org/releases/$oldstable_branch-SNAPSHOT/targets",
484+ "version_url ": "https://mirror-03.infra.openwrt.org/releases/$oldstable_branch-SNAPSHOT/targets",
482485 "generated_at": "$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")"
483486 }
484487 EOF
0 commit comments