Skip to content

Commit

Permalink
feat(ci): add local state test
Browse files Browse the repository at this point in the history
  • Loading branch information
lakkeger committed May 15, 2024
1 parent 13e0c9a commit c220895
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,37 @@ jobs:
with:
state-name: cloud-pods-test
state-action: save
no-startup: 'true'
skip-startup: 'true'
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}

local-state-test:
name: 'Test Local State Action'
runs-on: ubuntu-latest
steps:
- name: ⚡️ Checkout the repository
uses: actions/checkout@v3

- name: Start LocalStack
uses: ./
with:
image-tag: 'latest'
install-awslocal: 'true'
use-pro: 'true'
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}

- name: Run AWS commands
run: |
awslocal s3 mb s3://test
awslocal sqs create-queue --queue-name test-queue
- name: Save the State into Artifact
uses: ./
with:
state-name: state-test
state-action: save
state-backend: local
skip-startup: 'true'
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ inputs:
Defaults to `` (empty) -> don't manage state
required: false
default: ''
state-local:
state-backend:
description: |
Either store the state of LocalStack locally or as a cloud pod.
Valid values are `cloud-pods` or `local`.
Expand Down Expand Up @@ -105,7 +105,7 @@ runs:
env:
action-version: ${{ fromJSON(format('["{0}","{1}"]', github.ref_name, github.head_ref))[github.event_name == 'pull_request'] }}
with:
uses: LocalStack/setup-localstack/${{ inputs.state-local }}@${{ env.action-version }}
uses: LocalStack/setup-localstack/${{ inputs.state-backend }}@${{ env.action-version }}
with: |-
{
"name": "${{ inputs.state-name }}",
Expand Down

0 comments on commit c220895

Please sign in to comment.