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 }}", diff --git a/local/action.yml b/local/action.yml index 3afd5b9..5984f34 100644 --- a/local/action.yml +++ b/local/action.yml @@ -25,10 +25,10 @@ runs: - run: | if [ "$ACTION" = "save" ]; then echo "Saving State $NAME" - localstack state export $NAME + localstack state export ${NAME}.zip elif [ "$ACTION" = "load" ]; then echo "Loading State $NAME" - localstack state import $NAME + localstack state import ${NAME}.zip else echo "Invalid action: $ACTION" exit 1