CI: Fix frontend-metrics-step (attempt #1) (#74838)

* use grafana/public instead

* parameterise script (still need to fix + run drone locally)

* make drone

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
Kevin Minehart
2023-09-14 08:48:31 -05:00
committed by GitHub
parent af392c5886
commit 84d35e9f0b
3 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,11 @@
#!/usr/bin/env bash
set -e
BUILD_FOLDER=$1
if [ -z "$BUILD_FOLDER" ]; then
BUILD_FOLDER="./public/build"
fi
ERROR_COUNT="0"
ACCESSIBILITY_ERRORS="$(grep -oP '\"errors\":(\d+),' pa11y-ci-results.json | grep -oP '\d+')"
DIRECTIVES="$(grep -r -o directive public/app/ | wc -l)"
@ -10,7 +15,7 @@ CLASSNAME_PROP="$(grep -r -o -E --include="*.ts*" "\.*.className=\W.*\W.*" publi
EMOTION_IMPORTS="$(grep -r -o -E --include="*.ts*" --exclude="*.test*" "\{.*css.*\} from '@emotion/css'" public/app | wc -l)"
TS_FILES="$(find public/app -type f -name "*.ts*" -not -name "*.test*" | wc -l)"
TOTAL_BUNDLE="$(du -sk ./public/build | cut -f1)"
TOTAL_BUNDLE="$(du -sk $BUILD_FOLDER | cut -f1)"
OUTDATED_DEPENDENCIES="$(yarn outdated --all | grep -oP '[[:digit:]]+ *(?= dependencies are out of date)')"
## Disabled due to yarn PnP update breaking npm audit
#VULNERABILITY_AUDIT="$(yarn npm audit --all --recursive --json)"

View File

@ -633,8 +633,8 @@ def frontend_metrics_step(trigger = None):
},
"failure": "ignore",
"commands": [
"apk add --update bash grep",
"./scripts/ci-frontend-metrics.sh | ./bin/build publish-metrics $$GRAFANA_MISC_STATS_API_KEY",
"apk add --update bash grep git",
"./scripts/ci-frontend-metrics.sh ./grafana/public/build | ./bin/build publish-metrics $$GRAFANA_MISC_STATS_API_KEY",
],
}
if trigger: