Skip to content

Commit 6af07a9

Browse files
committed
update actions to capture dev and triggers
1 parent 2c19329 commit 6af07a9

File tree

4 files changed

+116
-59
lines changed

4 files changed

+116
-59
lines changed

.github/actions/nr-report-build-size/action.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/nightly.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,33 @@ jobs:
2626
node-version: 22.11.0 # See package.json for the stable node version that works with our testing. Do not change this unless you know what you are doing as some node versions do not play nicely with our testing server.
2727
- name: Install project dependencies
2828
run: npm ci
29-
# need to build so we have a stats file to reference
30-
- name: Build dev
31-
run: npm run cdn:build:dev
32-
# track build size as custom event
33-
- name: Report local stats as NR event
34-
uses: './.github/actions/nr-report-build-size'
29+
- name: Report lite size to NR
30+
uses: newrelic/capture-build-size@main
3531
with:
3632
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
37-
trigger: nightly
33+
nr-account-id: '550352'
34+
nr-env: 'staging'
35+
analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-rum-standard.stats.json'
36+
file-name-filter: '.min.js'
37+
trigger: 'nightly'
38+
- name: Report pro size to NR
39+
uses: newrelic/capture-build-size@main
40+
with:
41+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
42+
nr-account-id: '550352'
43+
nr-env: 'staging'
44+
analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json'
45+
file-name-filter: '.min.js'
46+
trigger: 'nightly'
47+
- name: Report spa size to NR
48+
uses: newrelic/capture-build-size@main
49+
with:
50+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
51+
nr-account-id: '550352'
52+
nr-env: 'staging'
53+
analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json'
54+
file-name-filter: '.min.js'
55+
trigger: 'nightly'
3856

3957
verify-ab-assets:
4058
name: Verify A/B Assets

.github/workflows/publish-dev.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,40 @@ jobs:
9999
commit: "${{ github.sha }}"
100100
version: "${{ github.ref_name }}"
101101
user: "${{ github.actor }}"
102-
# track build size as custom event
103-
- name: Report local stats as NR event
104-
uses: './.github/actions/nr-report-build-size'
102+
- name: Get local stats
103+
id: get-stats
104+
shell: bash
105+
run: |
106+
rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT;
107+
full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT;
108+
spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT;
109+
- name: Report lite size to NR
110+
uses: newrelic/capture-build-size@main
111+
with:
112+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
113+
nr-account-id: '550352'
114+
nr-env: 'staging'
115+
analysis-file-contents: ${{ steps.get-stats.outputs.rum }}
116+
file-name-filter: '.min.js'
117+
trigger: 'publish-dev'
118+
- name: Report pro size to NR
119+
uses: newrelic/capture-build-size@main
120+
with:
121+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
122+
nr-account-id: '550352'
123+
nr-env: 'staging'
124+
analysis-file-contents: ${{ steps.get-stats.outputs.full }}
125+
file-name-filter: '.min.js'
126+
trigger: 'publish-dev'
127+
- name: Report spa size to NR
128+
uses: newrelic/capture-build-size@main
105129
with:
106130
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
131+
nr-account-id: '550352'
132+
nr-env: 'staging'
133+
analysis-file-contents: ${{ steps.get-stats.outputs.spa }}
134+
file-name-filter: '.min.js'
135+
trigger: 'publish-dev'
107136

108137
# Publish dev to staging NRDB
109138
# publish-dev-nr:

.github/workflows/pull-request-checks.yml

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,67 @@ jobs:
9797
pr_number: ${{ github.event.number }}
9898
comment: ${{ steps.asset-size-report.outputs.results }}
9999
comment_tag: <!-- browser_agent asset size report -->
100-
- name: Report local stats as NR event
101-
uses: './.github/actions/nr-report-build-size'
100+
- name: Get local stats
101+
id: get-stats
102+
shell: bash
103+
run: |
104+
rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT;
105+
full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT;
106+
spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT;
107+
- name: Report lite size to NR
108+
uses: newrelic/capture-build-size@main
109+
with:
110+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
111+
nr-account-id: '550352'
112+
nr-env: 'staging'
113+
analysis-file-contents: ${{ steps.get-stats.outputs.rum }}
114+
file-name-filter: '.min.js'
115+
trigger: 'pull-request-checks'
116+
- name: Report pro size to NR
117+
uses: newrelic/capture-build-size@main
118+
with:
119+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
120+
nr-account-id: '550352'
121+
nr-env: 'staging'
122+
analysis-file-contents: ${{ steps.get-stats.outputs.full }}
123+
file-name-filter: '.min.js'
124+
trigger: 'pull-request-checks'
125+
- name: Report spa size to NR
126+
uses: newrelic/capture-build-size@main
127+
with:
128+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
129+
nr-account-id: '550352'
130+
nr-env: 'staging'
131+
analysis-file-contents: ${{ steps.get-stats.outputs.spa }}
132+
file-name-filter: '.min.js'
133+
trigger: 'pull-request-checks'
134+
- name: Report dev lite size to NR
135+
uses: newrelic/capture-build-size@main
136+
with:
137+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
138+
nr-account-id: '550352'
139+
nr-env: 'staging'
140+
analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-rum-standard.stats.json'
141+
file-name-filter: '.min.js'
142+
trigger: 'pull-request-checks'
143+
- name: Report dev pro size to NR
144+
uses: newrelic/capture-build-size@main
145+
with:
146+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
147+
nr-account-id: '550352'
148+
nr-env: 'staging'
149+
analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json'
150+
file-name-filter: '.min.js'
151+
trigger: 'pull-request-checks'
152+
- name: Report dev spa size to NR
153+
uses: newrelic/capture-build-size@main
102154
with:
103155
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
156+
nr-account-id: '550352'
157+
nr-env: 'staging'
158+
analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json'
159+
file-name-filter: '.min.js'
160+
trigger: 'pull-request-checks'
104161

105162
# Jobs for workflow_dispatch events
106163

0 commit comments

Comments
 (0)