CI: run LocalStack via lstk instead of the localstack PyPI package #84
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python LocalStack Client / Run Test | |
| on: | |
| pull_request: | |
| paths: | |
| - .github/workflows/test.yml | |
| - localstack-sdk-python/** | |
| - tests/** | |
| - packages/** | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| test_python: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Install project | |
| run: | | |
| make install-dev | |
| - name: Install lstk | |
| run: | | |
| npm install -g @localstack/lstk | |
| - name: Pull image | |
| run: | | |
| docker pull localstack/localstack-pro | |
| # lstk defaults to the aws emulator with image localstack/localstack-pro:latest, | |
| # so no config file is needed here. | |
| - name: Start Localstack | |
| env: | |
| LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} | |
| LOCALSTACK_DEBUG: "1" | |
| LOCALSTACK_DISABLE_EVENTS: "1" | |
| run: | | |
| lstk start --timeout 2m | |
| - name: Run Python Tests | |
| env: | |
| LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} | |
| run: | | |
| make test | |
| - name: Stop Localstack | |
| if: always() | |
| run: | | |
| lstk logs | |
| lstk stop |