1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00
metamask-extension/.circleci/scripts/bundle-stats-commit.sh

87 lines
2.0 KiB
Bash
Raw Normal View History

Bundlesize stats over time (#15209) * Adding tasks for MV3 test build * more changes * fix * fix * fix * MV3 CI fixes * fixes * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fixes * Adding build artifact for initialisation time * change * fix lint * fix * fix * fix * fix * fixes * Capturing load time stats * fix * fix * fix * fix * fix build * fix * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> chrome debug logs Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> split output of lavamoat to 2 files. background and ui Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * Enable logging to chrome_debug only if in MV3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fixes * fix * fix * fix * fix * fixes * test * test * fix * fix * MV3 bundle size stats * fix * Committing bundle size status to extension_bundlesize_stats repo * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * Initial commit * Initial commit * Initial commit * Initial commit * fixes * fix * fix * fix * fix * fix * fix Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-07-22 00:25:18 +02:00
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
if [[ "${CI:-}" != 'true' ]]
then
printf '%s\n' 'CI environment variable must be set to true'
exit 1
fi
if [[ "${CIRCLECI:-}" != 'true' ]]
then
printf '%s\n' 'CIRCLECI environment variable must be set to true'
exit 1
fi
if [[ "${CIRCLE_BRANCH}" != "develop" ]]
then
printf 'This is not develop branch'
exit 0
fi
Bundlesize stats over time (#15209) * Adding tasks for MV3 test build * more changes * fix * fix * fix * MV3 CI fixes * fixes * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fixes * Adding build artifact for initialisation time * change * fix lint * fix * fix * fix * fix * fixes * Capturing load time stats * fix * fix * fix * fix * fix build * fix * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> chrome debug logs Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> split output of lavamoat to 2 files. background and ui Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * Enable logging to chrome_debug only if in MV3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fixes * fix * fix * fix * fix * fixes * test * test * fix * fix * MV3 bundle size stats * fix * Committing bundle size status to extension_bundlesize_stats repo * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * Initial commit * Initial commit * Initial commit * Initial commit * fixes * fix * fix * fix * fix * fix * fix Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-07-22 00:25:18 +02:00
if [[ -z "${GITHUB_TOKEN:-}" ]]
then
printf '%s\n' 'GITHUB_TOKEN environment variable must be set'
exit 1
elif [[ -z "${GITHUB_TOKEN_USER:-}" ]]
then
printf '%s\n' 'GITHUB_TOKEN_USER environment variable must be set'
exit 1
fi
mkdir temp
git config --global user.email "metamaskbot@users.noreply.github.com"
git config --global user.name "MetaMask Bot"
git clone git@github.com:MetaMask/extension_bundlesize_stats.git temp
2022-09-16 18:56:36 +02:00
{
echo " '${CIRCLE_SHA1}': ";
cat test-artifacts/chrome/mv3/bundle_size_stats.json;
echo ", ";
} >> temp/stats/bundle_size_data.temp.js
Bundlesize stats over time (#15209) * Adding tasks for MV3 test build * more changes * fix * fix * fix * MV3 CI fixes * fixes * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fixes * Adding build artifact for initialisation time * change * fix lint * fix * fix * fix * fix * fixes * Capturing load time stats * fix * fix * fix * fix * fix build * fix * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> chrome debug logs Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> split output of lavamoat to 2 files. background and ui Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * Enable logging to chrome_debug only if in MV3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fixes * fix * fix * fix * fix * fixes * test * test * fix * fix * MV3 bundle size stats * fix * Committing bundle size status to extension_bundlesize_stats repo * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * Initial commit * Initial commit * Initial commit * Initial commit * fixes * fix * fix * fix * fix * fix * fix Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-07-22 00:25:18 +02:00
2022-09-16 18:56:36 +02:00
cp temp/stats/bundle_size_data.temp.js temp/stats/bundle_size_data.js
Bundlesize stats over time (#15209) * Adding tasks for MV3 test build * more changes * fix * fix * fix * MV3 CI fixes * fixes * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fixes * Adding build artifact for initialisation time * change * fix lint * fix * fix * fix * fix * fixes * Capturing load time stats * fix * fix * fix * fix * fix build * fix * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> chrome debug logs Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> split output of lavamoat to 2 files. background and ui Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * Enable logging to chrome_debug only if in MV3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fixes * fix * fix * fix * fix * fixes * test * test * fix * fix * MV3 bundle size stats * fix * Committing bundle size status to extension_bundlesize_stats repo * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * Initial commit * Initial commit * Initial commit * Initial commit * fixes * fix * fix * fix * fix * fix * fix Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-07-22 00:25:18 +02:00
2022-09-16 18:56:36 +02:00
echo " }" >> temp/stats/bundle_size_data.js
Bundlesize stats over time (#15209) * Adding tasks for MV3 test build * more changes * fix * fix * fix * MV3 CI fixes * fixes * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fixes * Adding build artifact for initialisation time * change * fix lint * fix * fix * fix * fix * fixes * Capturing load time stats * fix * fix * fix * fix * fix build * fix * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> chrome debug logs Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> split output of lavamoat to 2 files. background and ui Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * Enable logging to chrome_debug only if in MV3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fixes * fix * fix * fix * fix * fixes * test * test * fix * fix * MV3 bundle size stats * fix * Committing bundle size status to extension_bundlesize_stats repo * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * Initial commit * Initial commit * Initial commit * Initial commit * fixes * fix * fix * fix * fix * fix * fix Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-07-22 00:25:18 +02:00
if [ -f temp/stats/bundle_size_data.json ]; then
# copy bundle_size_data.json in bundle_size_data.temp.json without last 2 lines
head -$(($(wc -l < temp/stats/bundle_size_data.json) - 2)) temp/stats/bundle_size_data.json > bundle_size_stats.temp.json
{
echo "},";
echo "\"$CIRCLE_SHA1\":";
cat test-artifacts/chrome/mv3/bundle_size_stats.json;
echo "}";
} >> bundle_size_stats.temp.json
else
{
echo "{";
echo "\"$CIRCLE_SHA1\":";
cat test-artifacts/chrome/mv3/bundle_size_stats.json;
echo "}";
} > bundle_size_stats.temp.json
fi
jq . bundle_size_stats.temp.json > temp/stats/bundle_size_data.json
rm bundle_size_stats.temp.json
Bundlesize stats over time (#15209) * Adding tasks for MV3 test build * more changes * fix * fix * fix * MV3 CI fixes * fixes * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fixes * Adding build artifact for initialisation time * change * fix lint * fix * fix * fix * fix * fixes * Capturing load time stats * fix * fix * fix * fix * fix build * fix * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> chrome debug logs Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> split output of lavamoat to 2 files. background and ui Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * Enable logging to chrome_debug only if in MV3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fixes * fix * fix * fix * fix * fixes * test * test * fix * fix * MV3 bundle size stats * fix * Committing bundle size status to extension_bundlesize_stats repo * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * Initial commit * Initial commit * Initial commit * Initial commit * fixes * fix * fix * fix * fix * fix * fix Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-07-22 00:25:18 +02:00
cd temp
git add .
2022-09-16 18:56:36 +02:00
git commit --message "Adding bundle size at commit: ${CIRCLE_SHA1}"
Bundlesize stats over time (#15209) * Adding tasks for MV3 test build * more changes * fix * fix * fix * MV3 CI fixes * fixes * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fixes * Adding build artifact for initialisation time * change * fix lint * fix * fix * fix * fix * fixes * Capturing load time stats * fix * fix * fix * fix * fix build * fix * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * chrome debug logs * Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * comment out stats stuffs Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fix * Initial work to capture the logs, write to file, and parse it. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> chrome debug logs Pull logs from webdriver and save to json file. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Remove console.log Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> split output of lavamoat to 2 files. background and ui Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * Enable logging to chrome_debug only if in MV3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * fix * fix * fix * fixes * fix * fix * fix * fix * fixes * test * test * fix * fix * MV3 bundle size stats * fix * Committing bundle size status to extension_bundlesize_stats repo * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * Initial commit * Initial commit * Initial commit * Initial commit * fixes * fix * fix * fix * fix * fix * fix Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-07-22 00:25:18 +02:00
repo_slug="$CIRCLE_PROJECT_USERNAME/extension_bundlesize_stats"
git push "https://$GITHUB_TOKEN_USER:$GITHUB_TOKEN@github.com/$repo_slug" main
cd ..
rm -rf temp