Skip to content

Commit d88b62f

Browse files
committed
Configure CI environment
1 parent 1feaef8 commit d88b62f

File tree

1 file changed

+47
-35
lines changed

1 file changed

+47
-35
lines changed

action.yml

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,89 @@
1-
name: 'Setup LocalStack'
2-
description: 'Sets up LocalStack CLI in your GitHub Actions workflow.'
3-
author: 'LocalStack Team'
1+
name: "Setup LocalStack"
2+
description: "Sets up LocalStack CLI in your GitHub Actions workflow."
3+
author: "LocalStack Team"
44

55
branding:
6-
icon: 'code'
7-
color: 'white'
6+
icon: "code"
7+
color: "white"
88

99
inputs:
1010
image-tag:
11-
description: 'Tag of the LocalStack Docker image to use'
11+
description: "Tag of the LocalStack Docker image to use"
1212
required: true
13-
default: 'latest'
13+
default: "latest"
1414
install-awslocal:
15-
description: 'Whether to install the `awslocal` CLI into the environment'
15+
description: "Whether to install the `awslocal` CLI into the environment"
1616
required: true
17-
default: 'true'
17+
default: "true"
1818
use-pro:
19-
description: 'Whether to use LocalStack Pro (requires a valid CI Auth Token)'
19+
description: "Whether to use LocalStack Pro (requires a valid CI Auth Token)"
2020
required: false
21-
default: 'false'
21+
default: "false"
2222
configuration:
23-
description: 'Configuration variables to use for LocalStack'
23+
description: "Configuration variables to use for LocalStack"
2424
required: false
25-
default: ''
25+
default: ""
2626
ci-project:
27-
description: 'Name of the CI project to track in LocalStack Cloud'
27+
description: "Name of the CI project to track in LocalStack Cloud"
2828
required: false
29-
default: ''
29+
default: ""
3030
github-token:
31-
description: 'Github token used to create PR comments'
31+
description: "Github token used to create PR comments"
3232
required: false
33-
default: ''
33+
default: ""
3434
preview-cmd:
35-
description: 'Command(s) used to create an Ephemeral Instance of the PR (can use $AWS_ENDPOINT_URL)'
35+
description: "Command(s) used to create an Ephemeral Instance of the PR (can use $AWS_ENDPOINT_URL)"
3636
required: false
3737
include-preview:
38-
description: 'Whether to include the created Ephemeral Instance URL in the PR comment'
38+
description: "Whether to include the created Ephemeral Instance URL in the PR comment"
3939
required: false
4040
skip-startup:
4141
description: |
4242
Explicitly prevent LocalStack start up, only installs CLI(s).
4343
Recommended to manage state later on in the pipeline or start up an ephemeral instance
4444
required: true
45-
default: 'false'
45+
default: "false"
4646
skip-wait:
47-
description: 'Skip wait for LocalStack'
47+
description: "Skip wait for LocalStack"
4848
required: false
49-
default: 'false'
49+
default: "false"
5050
skip-ephemeral-stop:
51-
description: 'Skip stopping LocalStack Ephemeral Instance'
51+
description: "Skip stopping LocalStack Ephemeral Instance"
5252
required: false
53-
default: 'true'
53+
default: "true"
54+
skip-configure-environment:
55+
description: Do not configure the CI environment to talk to LocalStack by default
56+
required: false
57+
default: ""
5458
state-action:
5559
description: |
5660
Manage LocalStack state
5761
Valid values are `load`, `save`, `start`, `stop`, `` (empty, don't manage state)
5862
Values `start`/`stop` only usable with Ephemeral Instances.
5963
required: false
60-
default: ''
64+
default: ""
6165
state-backend:
6266
description: |
6367
Either store the state of LocalStack locally, as a cloud pod or start up an ephemeral instance.
6468
Valid values are `cloud-pods`, `ephemeral` or `local`.
6569
Use this option in unison with `state-action` to control behaviour.
6670
required: false
67-
default: 'cloud-pods'
71+
default: "cloud-pods"
6872
state-name:
69-
description: 'Name of the state artifact (without extension)'
73+
description: "Name of the state artifact (without extension)"
7074
required: false
7175
auto-load-pod:
72-
description: 'The pod to load on startup of LocalStack, the env var AUTO_LOAD_POD'
76+
description: "The pod to load on startup of LocalStack, the env var AUTO_LOAD_POD"
7377
required: false
74-
default: ''
78+
default: ""
7579
extension-auto-install:
76-
description: 'The extension(s) to automatically install on startup of LocalStack, the env var EXTENSION_AUTO_INSTALL'
80+
description: "The extension(s) to automatically install on startup of LocalStack, the env var EXTENSION_AUTO_INSTALL"
7781
required: false
78-
default: ''
82+
default: ""
7983
lifetime:
80-
description: 'The lifetime of the ephemeral instance, how long the instance should be available for'
84+
description: "The lifetime of the ephemeral instance, how long the instance should be available for"
8185
required: false
82-
default: '30'
86+
default: "30"
8387

8488
runs:
8589
using: "composite"
@@ -124,6 +128,14 @@ runs:
124128
"skip-wait": ${{ toJSON(inputs.skip-wait) }}
125129
}
126130
131+
- name: Configure CI environment to use LocalStack
132+
if: ${{ inputs.skip-configure-environment != 'true' }}
133+
shell: bash
134+
run: >
135+
echo "AWS_ENDPOINT_URL=http://localhost.localstack.cloud:4566" >> $GITHUB_ENV
136+
echo "AWS_ACCESS_KEY_ID=test" >> $GITHUB_ENV
137+
echo "AWS_SECRET_ACCESS_KEY" >> $GITHUB_ENV
138+
127139
- name: Create Ephemeral Instance
128140
if: ${{ inputs.state-action == 'start' && inputs.state-backend == 'ephemeral' }}
129141
uses: jenseng/dynamic-uses@8bc24f0360175e710da532c4d19eafdbed489a06 # v1
@@ -161,7 +173,7 @@ runs:
161173
"ci-project": ${{ toJSON(inputs.ci-project) }},
162174
"include-preview": ${{ inputs.include-preview != '' && toJSON(inputs.include-preview) || toJSON(env.include-preview) }}
163175
}
164-
176+
165177
- name: Stop Ephemeral Instance
166178
if: ${{ (inputs.skip-ephemeral-stop == 'false' || inputs.state-action == 'stop') && inputs.state-backend == 'ephemeral' }}
167179
uses: jenseng/dynamic-uses@8bc24f0360175e710da532c4d19eafdbed489a06 # v1
@@ -170,4 +182,4 @@ runs:
170182
with: |-
171183
{
172184
"github-token": ${{ toJSON(inputs.github-token) }},
173-
}
185+
}

0 commit comments

Comments
 (0)