Skip to content

Commit e7c33b6

Browse files
authored
Merge pull request #5682 from NomicFoundation/galargh/fix-bundle-size-inspection
ci: fix hardhat dependencies reporting
2 parents 622cd33 + 9155970 commit e7c33b6

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/v-next-ci.yml

+20-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,21 @@ jobs:
108108
run: pnpm build
109109
# https://github.com/pnpm/pnpm/issues/6166
110110
- name: Deploy
111-
run: pnpm deploy --config.shamefully-hoist=true --config.hoist=true --config.node-linker=true --config.shared-workspace-lockfile=false --filter="$(jq -r .name package.json)" --prod --no-optional bundle
111+
run: |
112+
pnpm deploy --config.shamefully-hoist=true --config.hoist=true --config.node-linker=true --config.shared-workspace-lockfile=false --filter="$(jq -r .name package.json)" --prod --no-optional bundle
113+
# We need to move the node_modules links from v-next/hardhat/bundle to bundle because
114+
# https://github.com/pnpm/pnpm/pull/8465 broke modules generation with the set of options we provide
115+
for old_link in $(find v-next/hardhat/bundle -type l); do
116+
echo "Processing link $old_link"
117+
new_link="${old_link#v-next/hardhat/}"
118+
new_link_dir="$(dirname "$new_link")"
119+
old_link_target="$(readlink -f "$old_link")"
120+
mkdir -p "$new_link_dir"
121+
ln -rs "$old_link_target" "$new_link"
122+
new_link_target="$(readlink "$new_link")"
123+
echo "Created link $new_link -> $new_link_target"
124+
done
125+
rm -rf v-next
112126
- uses: actions/upload-artifact@v4
113127
with:
114128
name: ${{ matrix.package }}
@@ -135,7 +149,11 @@ jobs:
135149
fi
136150
shell: bash
137151
- uses: actions/download-artifact@v4
152+
- id: download
153+
run: ls -1 | wc -l | xargs -I {} -0 echo "count={}" | tee -a $GITHUB_OUTPUT
154+
shell: bash
138155
- id: comment
156+
if: steps.download.outputs.count != '0'
139157
run: |
140158
echo 'body<<EOF' >> $GITHUB_OUTPUT
141159
for bundle in *; do
@@ -156,7 +174,7 @@ jobs:
156174
echo '' | tee -a $GITHUB_OUTPUT
157175
done
158176
echo 'EOF' >> $GITHUB_OUTPUT
159-
- if: github.event_name == 'pull_request'
177+
- if: github.event_name == 'pull_request' && steps.download.outputs.count != '0'
160178
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
161179
with:
162180
header: bundle

0 commit comments

Comments
 (0)