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

chore: add build stats history json file (#16168)

This commit is contained in:
Michele Esposito 2022-10-13 11:59:22 +02:00 committed by GitHub
parent 9372ce0ec7
commit 41e3ab189c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -727,6 +727,9 @@ jobs:
- run:
name: Run page load benchmark
command: yarn mv3:stats:chrome --out test-artifacts/chrome/mv3
- run:
name: Install jq
command: sudo apt install jq -y
- run:
name: Record bundle size at commit
command: ./.circleci/scripts/bundle-stats-commit.sh

View File

@ -50,6 +50,28 @@ cp temp/stats/bundle_size_data.temp.js temp/stats/bundle_size_data.js
echo " }" >> temp/stats/bundle_size_data.js
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
cd temp
git add .