Skip to content

Commit d8898a4

Browse files
committed
better dependency graph
1 parent 3500c6b commit d8898a4

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ env:
4848
${{ github.workspace }}/packages/ember/*.d.ts
4949
${{ github.workspace }}/packages/gatsby/*.d.ts
5050
51+
CACHED_BUILD_LAYER_PATHS: |
52+
${{ github.workspace }}/packages/*/build/aws
53+
5154
BUILD_CACHE_TARBALL_KEY: tarball-${{ github.event.inputs.commit || github.sha }}
5255

5356
# GH will use the first restore-key it finds that matches
@@ -165,8 +168,8 @@ jobs:
165168
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
166169
'@sentry-internal/browser-integration-tests') }}
167170

168-
job_verify_build_layer:
169-
name: Verify Lambda layer build
171+
job_build_layer:
172+
name: Build Lambda layer
170173
needs: [job_get_metadata, job_build]
171174
timeout-minutes: 10
172175
runs-on: ubuntu-24.04
@@ -186,6 +189,15 @@ jobs:
186189
- name: Build Lambda layer
187190
run: yarn build:layer
188191

192+
- name: Upload build artifacts
193+
uses: actions/upload-artifact@v7
194+
with:
195+
name: build-layer-output
196+
path: ${{ env.CACHED_BUILD_LAYER_PATHS }}
197+
retention-days: 4
198+
compression-level: 6
199+
overwrite: true
200+
189201
job_check_branches:
190202
name: Check PR branches
191203
needs: job_get_metadata
@@ -319,7 +331,7 @@ jobs:
319331

320332
job_artifacts:
321333
name: Upload Artifacts
322-
needs: [job_get_metadata, job_build]
334+
needs: [job_get_metadata, job_build, job_build_layer]
323335
runs-on: ubuntu-24.04
324336
# Build artifacts are only needed for releasing workflow.
325337
if: needs.job_get_metadata.outputs.is_release == 'true'
@@ -337,12 +349,14 @@ jobs:
337349
with:
338350
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
339351

352+
- name: Restore build layer artifacts
353+
uses: actions/download-artifact@v7
354+
with:
355+
name: build-layer-output
356+
340357
- name: Pack tarballs
341358
run: yarn build:tarball
342359

343-
- name: Build Lambda layer
344-
run: yarn build:layer
345-
346360
- name: Archive artifacts
347361
uses: actions/upload-artifact@v7
348362
with:
@@ -926,7 +940,7 @@ jobs:
926940
# See: https://github.com/actions/runner/issues/2205
927941
if:
928942
always() && needs.job_e2e_prepare.result == 'success' && needs.job_e2e_prepare.outputs.matrix != '{"include":[]}'
929-
needs: [job_get_metadata, job_build, job_e2e_prepare]
943+
needs: [job_get_metadata, job_build, job_build_layer, job_e2e_prepare]
930944
runs-on: ubuntu-24.04
931945
timeout-minutes: 15
932946
env:
@@ -972,6 +986,12 @@ jobs:
972986
with:
973987
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
974988

989+
- name: Restore build layer artifacts
990+
uses: actions/download-artifact@v7
991+
if: matrix.test-application == 'aws-serverless'
992+
with:
993+
name: build-layer-output
994+
975995
- name: Restore tarball cache
976996
uses: actions/cache/restore@v5
977997
id: restore-tarball-cache

0 commit comments

Comments
 (0)