From 8e391f7ec791de8188a6a0dc02c8820d85483d62 Mon Sep 17 00:00:00 2001 From: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Wed, 31 May 2023 14:17:18 -0700 Subject: [PATCH] ci(workflow): upload Turbopack bytesize to datadog pipeline --- .github/workflows/build_and_deploy.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index bdd2b99f817b9..99c1efc0294e0 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -241,6 +241,23 @@ jobs: if: ${{ !matrix.settings.docker }} shell: bash + # Trying to upload metrics for the Turbopack to datadog's CI pipeline execution + - name: 'Upload turbopack build metrics' + shell: bash + if: ${{ needs.build.outputs.isRelease == 'true' }} + continue-on-error: true + run: | + npm install -g @datadog/datadog-ci + for filename in packages/next-swc/native/next-swc.*.node; do + # Strip out filename to extract target triple + export FILENAME=$(basename ${filename}) + export FILENAME=${FILENAME#*.} + export FILENAME=${FILENAME%.node} + export BYTESIZE=$(wc -c < $filename | xargs) + echo "Reporting $FILENAME:$BYTESIZE for Turbopack bytesize" + datadog-ci metric --no-fail --level pipeline --metrics "turbopack.bytesize.$FILENAME:$BYTESIZE" + done + - name: Upload artifact if: ${{ needs.build.outputs.isRelease == 'true' }} uses: actions/upload-artifact@v3