Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,27 @@ jobs:
- name: "Install Project"
run: make install-dev

- name: "Install LocalStack"
run: pip install localstack==${RELEASE_VERSION}
- name: "Install lstk"
run: npm install -g @localstack/lstk

- name: "Configure lstk"
# The config pins the emulator image to the release version. It lives outside
# the workspace so the "Check Uncommitted Changes" step stays clean.
run: |
cat > "${RUNNER_TEMP}/lstk-config.toml" <<EOF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity is it possible at all to change the chosen image without using the config ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our decision back then was to consciously have the main way of doing this be the config file.

Could be that we added option overrides since then, but IMO both locally and in CI it's better to just have a clear file that defines your setup vs. attaching an increasing list of CLI parameters to your call.

[[containers]]
type = "aws"
tag = "${RELEASE_VERSION}"
port = "4566"
EOF
echo "LSTK_CONFIG_FILE=${RUNNER_TEMP}/lstk-config.toml" >> "$GITHUB_ENV"

- name: "Start Localstack"
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
run: |
source .venv/bin/activate
DEBUG=1 DISABLE_EVENTS="1" IMAGE_NAME="localstack/localstack-pro:${RELEASE_VERSION}" localstack start -d
localstack wait -t 120 || (python -m localstack.cli.main logs && false)
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
LOCALSTACK_DEBUG: "1"
LOCALSTACK_DISABLE_EVENTS: "1"
run: lstk --config "${LSTK_CONFIG_FILE}" start --timeout 2m

- name: "Run Python Tests"
env:
Expand All @@ -83,9 +94,8 @@ jobs:
- name: "Stop Localstack"
if: success() || failure()
run: |
source .venv/bin/activate
localstack logs
localstack stop
lstk --config "${LSTK_CONFIG_FILE}" logs
lstk --config "${LSTK_CONFIG_FILE}" stop

- name: "Check Uncommitted Changes"
run: |
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,23 @@ jobs:
run: |
make install-dev

- name: Install LocalStack
- name: Install lstk
run: |
pip install --pre --upgrade localstack
npm install -g @localstack/lstk

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hopefully at some point lstk releases a github action? 👀

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup-localstack should probably handle the install in the future, yeah


- 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_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
LOCALSTACK_DEBUG: "1"
LOCALSTACK_DISABLE_EVENTS: "1"
run: |
source .venv/bin/activate
DEBUG=1 DISABLE_EVENTS="1" IMAGE_NAME="localstack/localstack-pro:latest" localstack start -d
localstack wait -t 120 || (python -m localstack.cli.main logs && false)
lstk start --timeout 2m

- name: Run Python Tests
env:
Expand All @@ -58,6 +60,5 @@ jobs:
- name: Stop Localstack
if: always()
run: |
source .venv/bin/activate
localstack logs
localstack stop
lstk logs
lstk stop
Loading