Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit f53475f

Browse files
committed
Cleanup
1 parent ddc5557 commit f53475f

File tree

3 files changed

+40
-31
lines changed

3 files changed

+40
-31
lines changed

.github/workflows/test.yml renamed to .github/workflows/test_production.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Test
1+
name: Test Production
22

33
on:
44
workflow_dispatch:
55
inputs:
66
debug_enabled:
7-
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
7+
description: "Run the build with tmate debugging enabled (true/false)? (see https://github.com/marketplace/actions/debugging-with-tmate)"
88
required: false
9-
default: false
9+
default: "false"
1010

1111
env:
1212
BUILD_CACHE_KEY: ${{ github.sha }}
@@ -16,7 +16,7 @@ env:
1616
jobs:
1717
test:
1818
runs-on: ubuntu-latest
19-
name: "Test Lambda Layer Build"
19+
name: "Test Lambda Layer Build (the current v1 that is in production, not the code from the branch)"
2020
steps:
2121
- name: Setup build cache
2222
uses: actions/cache@v2
@@ -36,3 +36,4 @@ jobs:
3636
zip_file_name: test-aws-lambda-layer.zip
3737
build_cache_paths: ${{ env.CACHED_BUILD_PATHS }}
3838
build_cache_key: ${{ env.BUILD_CACHE_KEY }}
39+
debug_enabled: ${{ github.event.inputs.debug_enabled }}

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ steps:
4141
zip_file_name: sentry-python-serverless.zip
4242
```
4343

44+
This test script illustrates the usage of the action:
45+
46+
[.github/workflows/test_production.yml](.github/workflows/test_production.yml)
47+
4448
For an full example usage see the Sentry Python SDK:
4549

4650
https://github.com/getsentry/sentry-python/blob/master/.github/workflows/ci.yml
@@ -49,12 +53,17 @@ https://github.com/getsentry/sentry-python/blob/master/.github/workflows/ci.yml
4953

5054
The following are all _required_.
5155

52-
| name | description |
53-
| ------------------- | ----------------------------------------------------------------------------- |
54-
| `artifact_name` | Name of the prepared articact the Lambda Layer zip file should be uploaded to |
55-
| `zip_file_name` | Name of the zip file that will be created |
56-
| `build_cache_key` | Build cache key |
57-
| `build_cache_paths` | Paths of the build cache |
56+
| name | description |
57+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
58+
| `artifact_name` | Name of the prepared articact the Lambda Layer zip file should be uploaded to |
59+
| `zip_file_name` | Name of the zip file that will be created |
60+
| `build_cache_key` | Build cache key |
61+
| `build_cache_paths` | Paths of the build cache |
62+
| `debug_enabled` | If set to "true" debugging is enabled and you can log into the running action. (See https://github.com/marketplace/actions/debugging-with-tmate) |
63+
64+
## Testing
65+
66+
If you want to see an example of a zip file this action can create looks like you can manually run the GitHub action "Test Production". This will create a dummy lambda layer (just containing one placeholder file) and the latest [relay](https://github.com/getsentry/relay) based Sentry Lambda Extension. After the GitHub action has run, you can download the generated artifact at the bottom of the summary page of the GitHub action result.
5867

5968
## Contributing
6069

action.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
11
name: "Build AWS Lambda Layer"
22
description: "Creates a Lambda layer including the Sentry SDK and the Sentry Lambda extension."
3+
34
inputs:
45
artifact_name:
5-
description: Name of the prepared articact the Lambda Layer zip file should be uploaded to
6+
description: "Name of the prepared articact the Lambda Layer zip file should be uploaded to"
67
required: true
78
zip_file_name:
8-
description: Name of the zip file that will be created
9+
description: "Name of the zip file that will be created"
910
required: true
1011
build_cache_key:
11-
description: Build cache key
12+
description: "Build cache key"
1213
required: true
1314
build_cache_paths:
14-
description: Paths of the build cache
15+
description: "Paths of the build cache"
1516
required: true
16-
on:
17-
workflow_dispatch:
18-
inputs:
19-
debug_enabled:
20-
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
21-
required: false
22-
default: false
17+
debug_enabled:
18+
description: 'Run the build with tmate debugging enabled? (https://github.com/marketplace/actions/debugging-with-tmate)'
19+
required: false
20+
default: "false"
21+
2322
runs:
2423
using: "composite"
2524
steps:
26-
- name: Check build cache
25+
- name: "Check build cache"
2726
uses: actions/cache@v2
2827
id: cache_built_packages
2928
with:
3029
path: ${{ inputs.build_cache_paths }}
3130
key: ${{ inputs.build_cache_key }}
32-
- name: Download and configure Sentry Lambda extension
31+
- name: "Download and configure Sentry Lambda extension"
3332
shell: bash
3433
run: |
3534
echo "Downloading Sentry Lambda extension..."
3635
mkdir -p dist-serverless/extensions
3736
curl -0 --silent --output dist-serverless/extensions/sentry-lambda-extension `curl -s https://release-registry.services.sentry.io/apps/sentry-lambda-extension/latest | jq -r .files.\"sentry-lambda-extension\".url`
3837
chmod +x dist-serverless/extensions/sentry-lambda-extension
3938
echo "Done downloading Sentry Lambda extension..."
40-
- name: Setup tmate session
41-
uses: mxschmitt/action-tmate@v3
42-
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
43-
- name: Create Lambda Layer zip
39+
- name: "Setup tmate session"
40+
uses: mxschmitt/action-tmate@v3
41+
if: ${{ inputs.debug_enabled == 'true' }}
42+
- name: "Create Lambda Layer zip"
4443
shell: bash
4544
run: |
4645
echo "Creating ${{ inputs.zip_file_name }}..."
@@ -52,10 +51,10 @@ runs:
5251
5352
echo "Contents of the created zip file:"
5453
unzip -Z ${{ inputs.zip_file_name }}
55-
- name: Setup tmate session
56-
uses: mxschmitt/action-tmate@v3
57-
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
58-
- name: Upload zip (will be picked up by Craft for deployment)
54+
- name: "Setup tmate session"
55+
uses: mxschmitt/action-tmate@v3
56+
if: ${{ inputs.debug_enabled == 'true' }}
57+
- name: "Upload zip (will be picked up by Craft for deployment)"
5958
uses: actions/upload-artifact@v3
6059
with:
6160
name: ${{ inputs.artifact_name }}

0 commit comments

Comments
 (0)