|
1 |
| -# setup-localstack |
2 |
| -Sets up LocalStack CLI in your GitHub Actions workflow ☁️ |
| 1 | +# Setup LocalStack |
| 2 | + |
| 3 | +[](https://github.com/HarshCasper/setup-localstack/actions/workflows/ci.yml) |
| 4 | + |
| 5 | + |
| 6 | +A GitHub Action to setup [LocalStack](https://github.com/localstack/localstack) on your GitHub Actions runner workflow by: |
| 7 | + |
| 8 | +- Pulling a specific version of the LocalStack Docker Image into the GitHub Action runner. |
| 9 | +- Configuring the [LocalStack CLI](https://docs.localstack.cloud/get-started/#localstack-cli) to launch the Docker container with an optional API token for pro usage. |
| 10 | +- Installing [LocalStack AWS CLI](https://github.com/localstack/awscli-local), a thin wrapper around the `aws` command line interface for use with LocalStack to run integration tests over AWS services. |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +To get started, you can use this minimal example: |
| 15 | + |
| 16 | +```yml |
| 17 | +- name: Start LocalStack |
| 18 | + uses: HarshCasper/[email protected] |
| 19 | + with: |
| 20 | + image-tag: 'latest' |
| 21 | + install-awslocal: 'true' |
| 22 | + env: |
| 23 | + LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} |
| 24 | +``` |
| 25 | +
|
| 26 | +### Inputs |
| 27 | +
|
| 28 | +|Input|Description |Default |
| 29 | +|--|--|--| |
| 30 | +|`image-tag` |Tag of the LocalStack Docker image to use |`latest` |
| 31 | +|`install-awslocal` |Whether to install the `awslocal` CLI into the build environment | `true` |
| 32 | + |
| 33 | +### Example workflow |
| 34 | + |
| 35 | +```yml |
| 36 | +name: LocalStack Test |
| 37 | +on: [ push, pull_request ] |
| 38 | +
|
| 39 | +jobs: |
| 40 | + localstack-action-test: |
| 41 | + name: 'Test LocalStack GitHub Action' |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v3 |
| 45 | +
|
| 46 | + - name: Start LocalStack |
| 47 | + uses: HarshCasper/[email protected] |
| 48 | + with: |
| 49 | + image-tag: 'latest' |
| 50 | + install-awslocal: 'true' |
| 51 | + env: |
| 52 | + LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} |
| 53 | +
|
| 54 | + - name: Run Tests against LocalStack |
| 55 | + run: | |
| 56 | + awslocal s3 mb s3://test |
| 57 | + awslocal s3 ls |
| 58 | + echo "Test Execution complete!" |
| 59 | +``` |
| 60 | + |
| 61 | +## License |
| 62 | + |
| 63 | +[MIT License](https://github.com/HarshCasper/validate-issues-over-pull-requests/blob/main/LICENSE) |
0 commit comments