Skip to content

Commit cac6ef4

Browse files
committed
use composite action
1 parent cd22684 commit cac6ef4

File tree

4 files changed

+35
-132
lines changed

4 files changed

+35
-132
lines changed
Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
1-
# This composite action is used to verify all loaders of a specific
2-
# version exist in NR environments.
1+
# This composite action is used to report the local build size to New Relic
2+
# You must build the agent before running this action
33

4-
name: 'NR Verify'
4+
name: 'Report Build Size to New Relic'
55

66
runs:
77
using: "composite"
88
steps:
99
- name: Install dependencies
1010
run: npm install --silent --no-progress --prefix $GITHUB_ACTION_PATH/..
1111
shell: bash
12-
- name: Run action script
13-
id: action-script
14-
run: |
15-
node $GITHUB_ACTION_PATH/index.js \
16-
${{ inputs.environment && format('--environment {0}', inputs.environment) || '' }} \
17-
--loader-version ${{ inputs.loader_version }}
18-
shell: bash
12+
- name: Get local stats
13+
id: get-stats
14+
run: |
15+
rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT;
16+
full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT;
17+
spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT;
18+
- name: Report rum size to NR
19+
uses: metal-messiah/webpack-build-size-action@main
20+
with:
21+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
22+
nr-account-id: '550352'
23+
nr-env: 'staging'
24+
analysis-file-contents: ${{ steps.get-stats.outputs.rum }}
25+
file-name-filter: '.min.js'
26+
- name: Report full size to NR
27+
uses: metal-messiah/webpack-build-size-action@main
28+
with:
29+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
30+
nr-account-id: '550352'
31+
nr-env: 'staging'
32+
analysis-file-contents: ${{ steps.get-stats.outputs.full }}
33+
file-name-filter: '.min.js'
34+
- name: Report spa size to NR
35+
uses: metal-messiah/webpack-build-size-action@main
36+
with:
37+
nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
38+
nr-account-id: '550352'
39+
nr-env: 'staging'
40+
analysis-file-contents: ${{ steps.get-stats.outputs.spa }}
41+
file-name-filter: '.min.js'

.github/actions/nr-report-build-size/args.js

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

.github/actions/nr-report-build-size/index.js

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

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

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -97,42 +97,8 @@ 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: Get local stats
101-
id: get-stats
102-
run: |
103-
rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT;
104-
full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT;
105-
spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT;
106-
- name: Clean branch name
107-
id: clean-branch-name
108-
run: echo "results=$(echo '${{ github.event.base_ref.ref_name || github.ref_name }}' | sed 's/refs\/heads\///g' | sed 's/[^[:alnum:].-]/-/g')" >> $GITHUB_OUTPUT
109-
- name: Report rum size to NR
110-
uses: metal-messiah/webpack-build-size-action@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-
version: ${{ steps.clean-branch-name.outputs.results }}
118-
- name: Report full size to NR
119-
uses: metal-messiah/webpack-build-size-action@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-
version: ${{ steps.clean-branch-name.outputs.results }}
127-
- name: Report spa size to NR
128-
uses: metal-messiah/webpack-build-size-action@main
129-
with:
130-
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-
version: ${{ steps.clean-branch-name.outputs.results }}
100+
- name: report local stats
101+
uses: './.github/actions/nr-report-build-size'
136102

137103
# Jobs for workflow_dispatch events
138104

0 commit comments

Comments
 (0)