-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(serverless): Use GitHub action to zip lambda layer (second try) #5093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
antonpirker
merged 5 commits into
7.x
from
antonpirker/WEBBACKEND-146-build-aws-lambda-layer-w-github-action
May 13, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ba0397c
Updated gitignore file
antonpirker 8f44a44
Removed zipping from build script
antonpirker 28a0d88
Assemble Lambda Layer zip using GitHub action.
antonpirker 721372c
Removed obsolete gitignore
antonpirker d3a0e97
Update .gitignore
antonpirker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -31,7 +31,8 @@ env: | |||||||
${{ github.workspace }}/packages/ember/*.d.ts | ||||||||
${{ github.workspace }}/packages/ember/instance-initializers | ||||||||
${{ github.workspace }}/packages/gatsby/*.d.ts | ||||||||
${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip | ||||||||
${{ github.workspace }}/packages/core/src/version.ts | ||||||||
${{ github.workspace }}/dist-serverless | ||||||||
|
||||||||
BUILD_CACHE_KEY: ${{ github.event.inputs.commit || github.sha }} | ||||||||
|
||||||||
|
@@ -99,6 +100,11 @@ jobs: | |||||||
# this file) to a constant and skip rebuilding all of the packages each time CI runs. | ||||||||
if: steps.cache_built_packages.outputs.cache-hit == '' | ||||||||
run: yarn build | ||||||||
- name: Save SDK version for later | ||||||||
run: | | ||||||||
echo "Saving SDK_VERSION for later" | ||||||||
export SDK_VERSION=$(cat packages/core/src/version.ts | cut -f5 -d' ' | tr -d "'" | tr -d ";") | ||||||||
echo $SDK_VERSION > dist-serverless/version | ||||||||
outputs: | ||||||||
# this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on | ||||||||
# `job_build` can't see `job_install_deps` and what it returned) | ||||||||
|
@@ -228,7 +234,6 @@ jobs: | |||||||
${{ github.workspace }}/packages/integrations/build/bundles/** | ||||||||
${{ github.workspace }}/packages/tracing/build/bundles/** | ||||||||
${{ github.workspace }}/packages/**/*.tgz | ||||||||
${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip | ||||||||
|
||||||||
job_unit_test: | ||||||||
name: Test (Node ${{ matrix.node }}) | ||||||||
|
@@ -315,10 +320,10 @@ jobs: | |||||||
uses: actions/checkout@v2 | ||||||||
with: | ||||||||
ref: ${{ env.HEAD_COMMIT }} | ||||||||
# TODO: removing `fetch-depth` below seems to have no effect, and the commit which added it had no description, | ||||||||
# so it's not clear why it's necessary. That said, right now ember tests are xfail, so it's a little hard to | ||||||||
# tell if it's safe to remove. Once ember tests are fixed, let's try again with it turned off, and if all goes | ||||||||
# well, we can pull it out. | ||||||||
# TODO: removing `fetch-depth` below seems to have no effect, and the commit which added it had no description, | ||||||||
# so it's not clear why it's necessary. That said, right now ember tests are xfail, so it's a little hard to | ||||||||
# tell if it's safe to remove. Once ember tests are fixed, let's try again with it turned off, and if all goes | ||||||||
# well, we can pull it out. | ||||||||
fetch-depth: 0 | ||||||||
- name: Set up Node | ||||||||
uses: actions/setup-node@v1 | ||||||||
|
@@ -501,3 +506,41 @@ jobs: | |||||||
run: | | ||||||||
cd packages/node-integration-tests | ||||||||
yarn test | ||||||||
|
||||||||
job_build_aws_lambda_layer: | ||||||||
name: Build AWS Lambda Layer | ||||||||
needs: job_build | ||||||||
runs-on: ubuntu-latest | ||||||||
steps: | ||||||||
- name: Check out current commit (${{ env.HEAD_COMMIT }}) | ||||||||
uses: actions/checkout@v2 | ||||||||
with: | ||||||||
ref: ${{ env.HEAD_COMMIT }} | ||||||||
- name: Set up Node | ||||||||
uses: actions/setup-node@v1 | ||||||||
with: | ||||||||
node-version: ${{ env.DEFAULT_NODE_VERSION }} | ||||||||
- name: Check dependency cache | ||||||||
uses: actions/cache@v2 | ||||||||
with: | ||||||||
path: ${{ env.CACHED_DEPENDENCY_PATHS }} | ||||||||
key: ${{ needs.job_build.outputs.dependency_cache_key }} | ||||||||
- name: Check build cache | ||||||||
uses: actions/cache@v2 | ||||||||
with: | ||||||||
path: ${{ env.CACHED_BUILD_PATHS }} | ||||||||
key: ${{ env.BUILD_CACHE_KEY }} | ||||||||
- name: Get SDK version | ||||||||
run: | | ||||||||
export SDK_VERSION=$(cat dist-serverless/version) | ||||||||
echo "SDK_VERSION=$SDK_VERSION" | ||||||||
echo "SDK_VERSION=$SDK_VERSION" >> $GITHUB_ENV | ||||||||
Comment on lines
+536
to
+537
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||
- uses: actions/upload-artifact@v3 | ||||||||
with: | ||||||||
name: ${{ env.HEAD_COMMIT }} | ||||||||
path: | | ||||||||
dist-serverless/* | ||||||||
- uses: getsentry/action-build-aws-lambda-extension@v1 | ||||||||
with: | ||||||||
artifact_name: ${{ env.HEAD_COMMIT }} | ||||||||
zip_file_name: sentry-node-serverless-${{ env.SDK_VERSION }}.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.