Skip to content

Commit 5d4337f

Browse files
silv-ioclaude
andauthored
CI: run LocalStack via lstk instead of the localstack PyPI package (#25)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 65ffb34 commit 5d4337f

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
@@ -64,16 +64,27 @@ jobs:
6464
- name: "Install Project"
6565
run: make install-dev
6666

67-
- name: "Install LocalStack"
68-
run: pip install localstack==${RELEASE_VERSION}
67+
- name: "Install lstk"
68+
run: npm install -g @localstack/lstk
69+
70+
- name: "Configure lstk"
71+
# The config pins the emulator image to the release version. It lives outside
72+
# the workspace so the "Check Uncommitted Changes" step stays clean.
73+
run: |
74+
cat > "${RUNNER_TEMP}/lstk-config.toml" <<EOF
75+
[[containers]]
76+
type = "aws"
77+
tag = "${RELEASE_VERSION}"
78+
port = "4566"
79+
EOF
80+
echo "LSTK_CONFIG_FILE=${RUNNER_TEMP}/lstk-config.toml" >> "$GITHUB_ENV"
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)