From a4db46179bd634f612e735cc36c41738fa7a896b Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Wed, 17 Jan 2024 23:15:13 +0100 Subject: [PATCH] CI: add meausing on duckdb-wasm npm library --- .github/workflows/main.yml | 4 ++++ scripts/npm_measure_lib.sh | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 scripts/npm_measure_lib.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65b7ed1c9d..7b864ca10a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1049,6 +1049,10 @@ jobs: name: duckdb-wasm-packages-loadable path: duckdb-wasm-packages.zip + - name: Measure NPM stats + run: | + ./scripts/npm_measure_lib.sh + - name: Publish to NPM env: NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} diff --git a/scripts/npm_measure_lib.sh b/scripts/npm_measure_lib.sh new file mode 100755 index 0000000000..1e60352a5d --- /dev/null +++ b/scripts/npm_measure_lib.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +PROJECT_ROOT="$(cd $(dirname "$BASH_SOURCE[0]") && cd .. && pwd)" &> /dev/null + +cd ${PROJECT_ROOT}/packages/duckdb-wasm +mkdir -p ./dist/img +cp ${PROJECT_ROOT}/misc/duckdb.svg ./dist/img/duckdb.svg +cp ${PROJECT_ROOT}/misc/duckdb_wasm.svg ./dist/img/duckdb_wasm.svg +${PROJECT_ROOT}/scripts/build_duckdb_badge.sh > ./dist/img/duckdb_version_badge.svg + +npm install -g pkg-size +pgk-size .