From c22089532c783325e2bb9139bebf38c724362d7c Mon Sep 17 00:00:00 2001 From: lakkeger Date: Wed, 15 May 2024 16:08:28 +0200 Subject: [PATCH] feat(ci): add local state test --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++++++++- action.yml | 4 ++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 187bbfa..e33a141 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} \ No newline at end of file diff --git a/action.yml b/action.yml index 26ab48d..8968110 100644 --- a/action.yml +++ b/action.yml @@ -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`. @@ -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 }}",