Skip to content

Commit

Permalink
ci(workflow): upload Turbopack bytesize to datadog pipeline (#50600)
Browse files Browse the repository at this point in the history
### What?

This PR updates existing CI worfklow for building Turbopack (`@next/swc`), and report its bytesize per target triple as additional metrics. It will be included in datadog's pipeline execution traces.

It would be better to track this per-PR, or per-commits but building all native binaries per each commit is too expensive. For now, tracking it when we deploy and actually build new release binaries.
  • Loading branch information
kwonoj committed Jun 5, 2023
1 parent 38f7c3b commit 419246c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,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
Expand Down

0 comments on commit 419246c

Please sign in to comment.