Skip to content

Commit b57849c

Browse files
committed
chore(ci): Do not build AWS lambda layer in build step
Instead, only build this before uploading artifacts, as we do not really need this before.
1 parent 7203205 commit b57849c

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,27 @@ jobs:
165165
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
166166
'@sentry-internal/browser-integration-tests') }}
167167

168+
job_verify_build_layer:
169+
name: Verify Lambda layer build
170+
needs: [job_get_metadata, job_build]
171+
timeout-minutes: 10
172+
runs-on: ubuntu-24.04
173+
steps:
174+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
175+
uses: actions/checkout@v6
176+
with:
177+
ref: ${{ env.HEAD_COMMIT }}
178+
- name: Set up Node
179+
uses: actions/setup-node@v6
180+
with:
181+
node-version-file: 'package.json'
182+
- name: Restore caches
183+
uses: ./.github/actions/restore-cache
184+
with:
185+
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
186+
- name: Build Lambda layer
187+
run: yarn build:layer
188+
168189
job_check_branches:
169190
name: Check PR branches
170191
needs: job_get_metadata
@@ -319,6 +340,9 @@ jobs:
319340
- name: Pack tarballs
320341
run: yarn build:tarball
321342

343+
- name: Build Lambda layer
344+
run: yarn build:layer
345+
322346
- name: Archive artifacts
323347
uses: actions/upload-artifact@v7
324348
with:
@@ -1134,6 +1158,7 @@ jobs:
11341158
job_check_lockfile,
11351159
job_check_format,
11361160
job_circular_dep_check,
1161+
job_verify_build_layer,
11371162
job_size_check,
11381163
]
11391164
# Always run this, even if a dependent job failed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"private": true,
33
"scripts": {
4-
"build": "node ./scripts/verify-packages-versions.js && nx run-many -t build:transpile build:types build:bundle build:layer",
4+
"build": "node ./scripts/verify-packages-versions.js && nx run-many -t build:transpile build:types build:bundle",
55
"build:bundle": "nx run-many -t build:bundle",
6+
"build:layer": "nx run-many -t build:layer",
67
"build:dev": "nx run-many -t build:types build:transpile",
78
"build:dev:filter": "nx run-many -t build:dev -p",
89
"build:transpile": "nx run-many -t build:transpile",

packages/aws-serverless/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@
8080
"@vercel/nft": "^1.3.0"
8181
},
8282
"scripts": {
83-
"build": "run-p build:transpile build:types build:extension && run-s build:layer",
83+
"build": "run-p build:transpile build:types",
8484
"build:extension": "rollup -c rollup.lambda-extension.config.mjs && yarn ts-node scripts/buildLambdaExtension.ts",
85-
"build:layer": "rimraf build/aws && yarn ts-node scripts/buildLambdaLayer.ts",
85+
"build:layer": "rimraf build/aws && yarn build:extension && yarn ts-node scripts/buildLambdaLayer.ts",
8686
"build:dev": "run-p build:transpile build:types",
8787
"build:transpile": "rollup -c rollup.npm.config.mjs",
8888
"build:types": "run-s build:types:core build:types:downlevel",

0 commit comments

Comments
 (0)