-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): Initial compilation report on test_programs (#6731)
- Loading branch information
Showing
3 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
current_dir=$(pwd) | ||
base_path="$current_dir/execution_success" | ||
test_dirs=$(ls $base_path) | ||
|
||
# Tests to be profiled for compilation report | ||
tests_to_profile=("sha256_regression" "regression_4709" "ram_blowup_regression") | ||
echo "{\"compilation_reports\": [ " > $current_dir/compilation_report.json | ||
|
||
ITER="1" | ||
NUM_ARTIFACTS=${#tests_to_profile[@]} | ||
|
||
for dir in ${tests_to_profile[@]}; do | ||
if [[ " ${excluded_dirs[@]} " =~ " ${dir} " ]]; then | ||
continue | ||
fi | ||
|
||
if [[ ${CI-false} = "true" ]] && [[ " ${ci_excluded_dirs[@]} " =~ " ${dir} " ]]; then | ||
continue | ||
fi | ||
|
||
cd $base_path/$dir | ||
|
||
COMPILE_TIME=$((time nargo compile --force) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s') | ||
echo -e " {\n \"artifact_name\":\"$dir\",\n \"time\":\"$COMPILE_TIME\"\n" >> $current_dir/compilation_report.json | ||
if (($ITER == $NUM_ARTIFACTS)); then | ||
echo "}" >> $current_dir/compilation_report.json | ||
else | ||
echo "}, " >> $current_dir/compilation_report.json | ||
fi | ||
|
||
ITER=$(( $ITER + 1 )) | ||
done | ||
|
||
echo "]}" >> $current_dir/compilation_report.json | ||
|