1919 image : ghcr.io/nrfconnect/sdk-sidewalk:main
2020 options : --cpus 2 --privileged
2121 outputs :
22- total_platforms_json : ${{ steps.platforms .outputs.total_platforms_json }}
22+ total_platforms_json : ${{ steps.subsets .outputs.total_platforms_json }}
2323 subset_matrix : ${{ steps.subsets.outputs.matrix }}
2424 subset_config : ${{ steps.subsets.outputs.config }}
2525 defaults :
@@ -40,30 +40,20 @@ jobs:
4040 west update -n -o=--depth=1 --path-cache /workdir/ &&
4141 ln -s sidewalk_tmp sidewalk
4242
43- - name : dry_run
44- run : |
45- west twister --test-config sidewalk/test_config.yaml --testsuite-root sidewalk --level="samples" --dry-run
46-
47- - name : get test targets
48- id : platforms
49- run : |
50- total_platforms=$(jq -r '.testsuites |map({platform: .platform}) | unique | .[].platform' twister-out/testplan.json)
51- total_platforms_json=$(printf '%s' "${total_platforms[@]}" | jq -R . | jq -s -c .)
52- echo "total_platforms_json=$total_platforms_json" >> $GITHUB_OUTPUT;
53-
5443 - name : subsets configuration
5544 id : subsets
5645 run : |
5746 rm -rf twister-out* max max_sorted configuration
5847 west twister --test-config sidewalk/test_config.yaml --testsuite-root sidewalk --level="samples" --dry-run
5948 total_platforms=$(jq -r '.testsuites |map({platform: .platform}) | unique | .[].platform' twister-out/testplan.json)
60- echo "[]" > configuration
49+ total_platforms_json=$(printf '%s' "${total_platforms[@]}" | jq -R . | jq -s -c .)
50+ echo "{}" > configuration
6151 for platform in $total_platforms; do
6252 west twister --test-config sidewalk/test_config.yaml --testsuite-root sidewalk --level="samples" --dry-run --platform $platform
6353 total_jobs=$(jq '.testsuites | length' twister-out/testplan.json)
6454 subsets=$(( ( total_jobs + ${{inputs.jobs_per_subset}}) / ${{inputs.jobs_per_subset}}))
6555 echo $subsets >> max
66- cat configuration | jq -c --arg platform_name $platform --arg subsets $subsets '. += [{"platform": $platform_name, "subsets" : $subsets}] ' > configuration_new
56+ cat configuration | jq -c --arg platform_name $platform --arg subsets $subsets '. += {( $platform_name) : $subsets|tonumber } ' > configuration_new
6757 mv configuration_new configuration
6858 done
6959 sort max > max_sorted
@@ -72,13 +62,14 @@ jobs:
7262 cat configuration
7363 echo $subset_matrix
7464
65+ echo "total_platforms_json=$total_platforms_json" >> $GITHUB_OUTPUT;
7566 echo "matrix=$subset_matrix" >> $GITHUB_OUTPUT;
7667 echo "config=`cat configuration`" >> $GITHUB_OUTPUT;
7768
7869 - name : clean
7970 if : always()
8071 run : |
81- rm -rf twister* sidewalk*
72+ rm -rf twister* sidewalk* max max_sorted configuration
8273
8374 build_samples :
8475 needs : [discover_targets]
0 commit comments