Skip to content

Commit d545737

Browse files
silv-ioclaude
andcommitted
CI: run LocalStack via lstk instead of the localstack PyPI package
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 65ffb34 commit d545737

2 files changed

Lines changed: 30 additions & 19 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
id-token: write
2525
env:
2626
RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.event.client_payload.version}}
27+
LSTK_CONFIG_FILE: ${{ runner.temp }}/lstk-config.toml
2728

2829
steps:
2930
- name: "Pull Image (localstack/localstack-pro:${{ env.RELEASE_VERSION }})"
@@ -64,16 +65,26 @@ jobs:
6465
- name: "Install Project"
6566
run: make install-dev
6667

67-
- name: "Install LocalStack"
68-
run: pip install localstack==${RELEASE_VERSION}
68+
- name: "Install lstk"
69+
run: npm install -g @localstack/lstk
70+
71+
- name: "Configure lstk"
72+
# The config pins the emulator image to the release version. It lives outside
73+
# the workspace so the "Check Uncommitted Changes" step stays clean.
74+
run: |
75+
cat > "${LSTK_CONFIG_FILE}" <<EOF
76+
[[containers]]
77+
type = "aws"
78+
tag = "${RELEASE_VERSION}"
79+
port = "4566"
80+
EOF
6981
7082
- name: "Start Localstack"
7183
env:
72-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
73-
run: |
74-
source .venv/bin/activate
75-
DEBUG=1 DISABLE_EVENTS="1" IMAGE_NAME="localstack/localstack-pro:${RELEASE_VERSION}" localstack start -d
76-
localstack wait -t 120 || (python -m localstack.cli.main logs && false)
84+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
85+
LOCALSTACK_DEBUG: "1"
86+
LOCALSTACK_DISABLE_EVENTS: "1"
87+
run: lstk --config "${LSTK_CONFIG_FILE}" start --timeout 2m
7788

7889
- name: "Run Python Tests"
7990
env:
@@ -83,9 +94,8 @@ jobs:
8394
- name: "Stop Localstack"
8495
if: success() || failure()
8596
run: |
86-
source .venv/bin/activate
87-
localstack logs
88-
localstack stop
97+
lstk --config "${LSTK_CONFIG_FILE}" logs
98+
lstk --config "${LSTK_CONFIG_FILE}" stop
8999
90100
- name: "Check Uncommitted Changes"
91101
run: |

.github/workflows/test.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,23 @@ jobs:
3333
run: |
3434
make install-dev
3535
36-
- name: Install LocalStack
36+
- name: Install lstk
3737
run: |
38-
pip install --pre --upgrade localstack
38+
npm install -g @localstack/lstk
3939
4040
- name: Pull image
4141
run: |
4242
docker pull localstack/localstack-pro
4343
44+
# lstk defaults to the aws emulator with image localstack/localstack-pro:latest,
45+
# so no config file is needed here.
4446
- name: Start Localstack
4547
env:
46-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
48+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
49+
LOCALSTACK_DEBUG: "1"
50+
LOCALSTACK_DISABLE_EVENTS: "1"
4751
run: |
48-
source .venv/bin/activate
49-
DEBUG=1 DISABLE_EVENTS="1" IMAGE_NAME="localstack/localstack-pro:latest" localstack start -d
50-
localstack wait -t 120 || (python -m localstack.cli.main logs && false)
52+
lstk start --timeout 2m
5153
5254
- name: Run Python Tests
5355
env:
@@ -58,6 +60,5 @@ jobs:
5860
- name: Stop Localstack
5961
if: always()
6062
run: |
61-
source .venv/bin/activate
62-
localstack logs
63-
localstack stop
63+
lstk logs
64+
lstk stop

0 commit comments

Comments
 (0)