mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Added new scripts to CI results
- Added to GitHub statuses (61 results) - Reworked generated release table to include these (16 results, only thumb) These also required a surprisingly large number of other changes: - Bumbed CI Ubuntu version 18.04 -> 20.04, 22.04 is already on the horizon but not usable in GitHub yet - Manualy upgrade to GCC v10, this is required for the -fcallgraph-info flag that scripts/stack.py uses. - Increased paginated status queries to 100 per-page. If we have more statuses than this the status diffs may get much more complicated... - Forced whitespace in generated release table to always be nbsp. GitHub tables get scrunched rather ugly without this, prefering margins to readable tables. - Added limited support for "∞" results, since this is returned by ./scripts/stack.py for recursive functions. As a side-note, this increases the number of statuses reported per-commit from 6 to 61, so hopefully that doesn't cause any problems...
This commit is contained in:
		
							
								
								
									
										139
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										139
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							| @@ -7,7 +7,7 @@ on: | ||||
|  | ||||
| jobs: | ||||
|   release: | ||||
|     runs-on: ubuntu-18.04 | ||||
|     runs-on: ubuntu-20.04 | ||||
|  | ||||
|     # need to manually check for a couple things | ||||
|     # - tests passed? | ||||
| @@ -73,89 +73,70 @@ jobs: | ||||
|           # previous results to compare against? | ||||
|           [ -n "$LFS_PREV_VERSION" ] && curl -sS \ | ||||
|             "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/` | ||||
|               `status/$LFS_PREV_VERSION" \ | ||||
|               `status/$LFS_PREV_VERSION?per_page=100" \ | ||||
|             | jq -re 'select(.sha != env.GITHUB_SHA) | .statuses[]' \ | ||||
|             >> prev-results.json \ | ||||
|             || true | ||||
|  | ||||
|           # unfortunately these each have their own format | ||||
|           [ -e results/code-thumb.csv ] && ( \ | ||||
|             export PREV="$(jq -re ' | ||||
|                   select(.context == "results / code").description | ||||
|                   | capture("Code size is (?<result>[0-9]+)").result' \ | ||||
|                 prev-results.json || echo 0)" | ||||
|             ./scripts/code.py -u results/code-thumb.csv --summary | awk ' | ||||
|               NR==2 {printf "Code size,%d B",$2} | ||||
|               NR==2 && ENVIRON["PREV"]+0 != 0 { | ||||
|                 printf " (%+.1f%%)",100*($2-ENVIRON["PREV"])/ENVIRON["PREV"]} | ||||
|               NR==2 {printf "\n"}' \ | ||||
|             >> results.csv) | ||||
|           [ -e results/code-thumb-readonly.csv ] && ( \ | ||||
|             export PREV="$(jq -re ' | ||||
|                   select(.context == "results / code (readonly)").description | ||||
|                   | capture("Code size is (?<result>[0-9]+)").result' \ | ||||
|                 prev-results.json || echo 0)" | ||||
|             ./scripts/code.py -u results/code-thumb-readonly.csv --summary | awk ' | ||||
|               NR==2 {printf "Code size<br/>(readonly),%d B",$2} | ||||
|               NR==2 && ENVIRON["PREV"]+0 != 0 { | ||||
|                 printf " (%+.1f%%)",100*($2-ENVIRON["PREV"])/ENVIRON["PREV"]} | ||||
|               NR==2 {printf "\n"}' \ | ||||
|             >> results.csv) | ||||
|           [ -e results/code-thumb-threadsafe.csv ] && ( \ | ||||
|             export PREV="$(jq -re ' | ||||
|                   select(.context == "results / code (threadsafe)").description | ||||
|                   | capture("Code size is (?<result>[0-9]+)").result' \ | ||||
|                 prev-results.json || echo 0)" | ||||
|             ./scripts/code.py -u results/code-thumb-threadsafe.csv --summary | awk ' | ||||
|               NR==2 {printf "Code size<br/>(threadsafe),%d B",$2} | ||||
|               NR==2 && ENVIRON["PREV"]+0 != 0 { | ||||
|                 printf " (%+.1f%%)",100*($2-ENVIRON["PREV"])/ENVIRON["PREV"]} | ||||
|               NR==2 {printf "\n"}' \ | ||||
|             >> results.csv) | ||||
|           [ -e results/code-thumb-migrate.csv ] && ( \ | ||||
|             export PREV="$(jq -re ' | ||||
|                   select(.context == "results / code (migrate)").description | ||||
|                   | capture("Code size is (?<result>[0-9]+)").result' \ | ||||
|                 prev-results.json || echo 0)" | ||||
|             ./scripts/code.py -u results/code-thumb-migrate.csv --summary | awk ' | ||||
|               NR==2 {printf "Code size<br/>(migrate),%d B",$2} | ||||
|               NR==2 && ENVIRON["PREV"]+0 != 0 { | ||||
|                 printf " (%+.1f%%)",100*($2-ENVIRON["PREV"])/ENVIRON["PREV"]} | ||||
|               NR==2 {printf "\n"}' \ | ||||
|             >> results.csv) | ||||
|           [ -e results/code-thumb-error-asserts.csv ] && ( \ | ||||
|             export PREV="$(jq -re ' | ||||
|                   select(.context == "results / code (error-asserts)").description | ||||
|                   | capture("Code size is (?<result>[0-9]+)").result' \ | ||||
|                 prev-results.json || echo 0)" | ||||
|             ./scripts/code.py -u results/code-thumb-error-asserts.csv --summary | awk ' | ||||
|               NR==2 {printf "Code size<br/>(error-asserts),%d B",$2} | ||||
|               NR==2 && ENVIRON["PREV"]+0 != 0 { | ||||
|                 printf " (%+.1f%%)",100*($2-ENVIRON["PREV"])/ENVIRON["PREV"]} | ||||
|               NR==2 {printf "\n"}' \ | ||||
|             >> results.csv) | ||||
|           [ -e results/coverage.csv ] && ( \ | ||||
|             export PREV="$(jq -re ' | ||||
|                   select(.context == "results / coverage").description | ||||
|                   | capture("Coverage is (?<result>[0-9\\.]+)").result' \ | ||||
|                 prev-results.json || echo 0)" | ||||
|             ./scripts/coverage.py -u results/coverage.csv --summary | awk -F '[ /%]+' ' | ||||
|               NR==2 {printf "Coverage,%.1f%% of %d lines",$4,$3} | ||||
|               NR==2 && ENVIRON["PREV"]+0 != 0 { | ||||
|                 printf " (%+.1f%%)",$4-ENVIRON["PREV"]} | ||||
|               NR==2 {printf "\n"}' \ | ||||
|             >> results.csv) | ||||
|           # build table for GitHub | ||||
|           echo "<table>" >> results.txt | ||||
|           echo "<thead>" >> results.txt | ||||
|           echo "<tr>" >> results.txt | ||||
|           echo "<th align=left>Configuration</th>" >> results.txt | ||||
|           for r in Code Stack Structs Coverage | ||||
|           do | ||||
|             echo "<th align=right>$r</th>" >> results.txt | ||||
|           done | ||||
|           echo "</tr>" >> results.txt | ||||
|           echo "</thead>" >> results.txt | ||||
|  | ||||
|           echo "<tbody>" >> results.txt | ||||
|           for c in "" readonly threadsafe migrate error-asserts | ||||
|           do | ||||
|             echo "<tr>" >> results.txt | ||||
|             c_or_default=${c:-default} | ||||
|             echo "<td align=left>${c_or_default^}</td>" >> results.txt | ||||
|             for r in code stack structs | ||||
|             do | ||||
|               # per-config results | ||||
|               echo "<td align=right>" >> results.txt | ||||
|               [ -e results/thumb${c:+-$c}.csv ] && ( \ | ||||
|                 export PREV="$(jq -re ' | ||||
|                       select(.context == "'"results (thumb${c:+, $c}) / $r"'").description | ||||
|                       | capture("(?<result>[0-9∞]+)").result' \ | ||||
|                     prev-results.json || echo 0)" | ||||
|                 ./scripts/summary.py results/thumb${c:+-$c}.csv -f $r -Y | awk ' | ||||
|                   NR==2 {printf "%s B",$2} | ||||
|                   NR==2 && ENVIRON["PREV"]+0 != 0 { | ||||
|                     printf " (%+.1f%%)",100*($2-ENVIRON["PREV"])/ENVIRON["PREV"]} | ||||
|                   NR==2 {printf "\n"}' \ | ||||
|                 | sed -e 's/ /\ /g' \ | ||||
|                 >> results.txt) | ||||
|               echo "</td>" >> results.txt | ||||
|             done | ||||
|             # coverage results | ||||
|             if [ -z $c ] | ||||
|             then | ||||
|               echo "<td rowspan=0 align=right>" >> results.txt | ||||
|               [ -e results/coverage.csv ] && ( \ | ||||
|                 export PREV="$(jq -re ' | ||||
|                       select(.context == "results / coverage").description | ||||
|                       | capture("(?<result>[0-9\\.]+)").result' \ | ||||
|                     prev-results.json || echo 0)" | ||||
|                 ./scripts/coverage.py -u results/coverage.csv -Y | awk -F '[ /%]+' ' | ||||
|                   NR==2 {printf "%.1f%% of %d lines",$4,$3} | ||||
|                   NR==2 && ENVIRON["PREV"]+0 != 0 { | ||||
|                     printf " (%+.1f%%)",$4-ENVIRON["PREV"]} | ||||
|                   NR==2 {printf "\n"}' \ | ||||
|                 | sed -e 's/ /\ /g' \ | ||||
|                 >> results.txt) | ||||
|               echo "</td>" >> results.txt | ||||
|             fi | ||||
|             echo "</tr>" >> results.txt | ||||
|           done | ||||
|           echo "</tbody>" >> results.txt | ||||
|           echo "</table>" >> results.txt | ||||
|  | ||||
|           # transpose to GitHub table | ||||
|           [ -e results.csv ] || exit 0 | ||||
|           awk -F ',' ' | ||||
|             {label[NR]=$1; value[NR]=$2} | ||||
|             END { | ||||
|               for (r=1; r<=NR; r++) {printf "| %s ",label[r]}; printf "|\n"; | ||||
|               for (r=1; r<=NR; r++) {printf "|:--"}; printf "|\n"; | ||||
|               for (r=1; r<=NR; r++) {printf "| %s ",value[r]}; printf "|\n"}' \ | ||||
|             results.csv > results.txt | ||||
|           echo "RESULTS:" | ||||
|           cat results.txt | ||||
|  | ||||
|       # find changes from history | ||||
|   | ||||
		Reference in New Issue
	
	Block a user