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
64 changes: 54 additions & 10 deletions .github/scripts/ci-checks.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,62 @@

#!/bin/sh
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.

Not blocking: Shebang is sh #!/bin/sh but lines 39 and 45 use bash array syntax (PACKAGES=( ... ), "${PACKAGES[@]}").

Will fail under dash (the default /bin/sh on Debian/Ubuntu).

either amend sheabing to #!/usr/bin/env bash, or rewrite to sh compliant.

Copy link
Copy Markdown
Contributor Author

@SilanHe SilanHe May 29, 2026

Choose a reason for hiding this comment

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


set -e

hatch run test:cov
echo SUCCESS: tests + coverage
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
cd "$REPO_ROOT"

# --- Core SDK checks ---
echo "=========================================="
echo "Running checks for aws-durable-execution-sdk-python"
echo "=========================================="

hatch run dev-core:cov
echo "SUCCESS: tests + coverage (core)"

hatch run dev-core:typecheck
echo "SUCCESS: typings (core)"

# --- OTel SDK checks ---
echo "=========================================="
echo "Running checks for aws-durable-execution-sdk-python-otel"
echo "=========================================="

hatch run dev-otel:cov
echo "SUCCESS: tests + coverage (otel)"

hatch run dev-otel:typecheck
echo "SUCCESS: typings (otel)"

# --- Examples checks ---
echo "=========================================="
echo "Running checks for examples"
echo "=========================================="

hatch run dev-examples:test
echo "SUCCESS: tests (examples)"

# --- Formatting / linting (per package) ---
PACKAGES=(
"packages/aws-durable-execution-sdk-python"
"packages/aws-durable-execution-sdk-python-otel"
"packages/aws-durable-execution-sdk-python-examples"
)

# type checks
hatch run types:check
echo SUCCESS: typings
for package_dir in "${PACKAGES[@]}"; do
full_path="$REPO_ROOT/$package_dir"
if [ -d "$full_path" ]; then
echo "=========================================="
echo "Running formatting/linting for $package_dir"
echo "=========================================="
cd "$full_path"
hatch fmt
echo "SUCCESS: linting/fmt ($package_dir)"
else
echo "WARNING: $package_dir does not exist, skipping fmt"
fi
done

# static analysis
hatch fmt
echo SUCCESS: linting/fmt
cd "$REPO_ROOT"

# commit message validation
# --- Commit message validation ---
hatch run python .github/scripts/lintcommit.py
4 changes: 2 additions & 2 deletions .github/scripts/lintcommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def lint_range(git_range: str, *, skip_dirty_check: bool = False) -> LintResult:
status = subprocess.run(
["git", "status", "--porcelain"],
capture_output=True,
text=True,
text=True, check=False,
)
if status.stdout.strip():
return LintResult(
Expand All @@ -178,7 +178,7 @@ def lint_range(git_range: str, *, skip_dirty_check: bool = False) -> LintResult:
result = subprocess.run(
["git", "log", "--no-merges", git_range, "-z", "--format=%H%n%B"],
capture_output=True,
text=True,
text=True, check=False,
)
if result.returncode != 0:
return LintResult(git_error=result.stderr.strip())
Expand Down
2 changes: 0 additions & 2 deletions .github/scripts/tests/test_lintcommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))

import pytest

from lintcommit import lint_range, validate_message, validate_subject


# region validate_subject: valid subjects


Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,26 @@ jobs:
run: |
python -m pip install hatch==1.16.5
- name: static analysis
run: hatch fmt --check
run: |
for pkg in packages/*/; do
if [ -f "$pkg/pyproject.toml" ]; then
echo "=== Checking format: $pkg ==="
cd "$pkg"
hatch fmt --check
cd "$GITHUB_WORKSPACE"
fi
done
- name: type checking
run: hatch run types:check
- name: Run tests + coverage
run: hatch run test:cov
- name: Build distribution
run: hatch build
run: |
for pkg in packages/*/; do
if [ -f "$pkg/pyproject.toml" ]; then
echo "=== Building: $pkg ==="
cd "$pkg"
hatch build
Comment thread
SilanHe marked this conversation as resolved.
cd "$GITHUB_WORKSPACE"
fi
done
14 changes: 9 additions & 5 deletions .github/workflows/deploy-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:
branches: [ "main", "development"]
paths:
- 'src/aws_durable_execution_sdk_python/**'
- 'examples/**'
- 'packages/aws-durable-execution-sdk-python/src/**'
- 'packages/aws-durable-execution-sdk-python-examples/**'
- '.github/workflows/deploy-examples.yml'
workflow_dispatch:

Expand All @@ -26,7 +26,7 @@ jobs:

- name: Get examples from catalog
id: get-examples
working-directory: ./examples
working-directory: ./packages/aws-durable-execution-sdk-python-examples
run: |
echo "examples=$(jq -c '.examples | map(select(.integration == true))' examples-catalog.json)" >> $GITHUB_OUTPUT

Expand Down Expand Up @@ -58,10 +58,14 @@ jobs:
- name: Install Hatch
run: pip install hatch
- name: Build examples
run: hatch run examples:build
working-directory: ./packages/aws-durable-execution-sdk-python-examples
run: |
hatch run -- examples:pip install -e ../aws-durable-execution-sdk-python
hatch run examples:build

- name: Deploy Lambda function - ${{ matrix.example.name }}
id: deploy
working-directory: ./packages/aws-durable-execution-sdk-python-examples
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
LAMBDA_ENDPOINT: "https://lambda.us-west-2.amazonaws.com"
Expand Down Expand Up @@ -115,7 +119,7 @@ jobs:
TEST_NAME="test_$(echo "${{ matrix.example.name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')"
echo "Test name: ${TEST_NAME}"

# Run integration tests
# Run integration tests from repo root
hatch run test:examples-integration

# Wait for function to be ready
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: aws/aws-durable-execution-sdk-python-testing
path: testing-sdk
path: language-sdk/packages/testing-sdk

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
Expand All @@ -40,13 +40,13 @@ jobs:
working-directory: language-sdk
run: |
echo "Running SDK tests..."
hatch run -- test:pip install -e ../testing-sdk
hatch run -- test:pip install -e ../language-sdk
hatch fmt --check
hatch run -- test:pip install -e packages/testing-sdk
hatch run types:check
hatch run test:cov
hatch run test:examples
hatch build

- name: Verify package build
working-directory: language-sdk/packages/aws-durable-execution-sdk-python
run: hatch build

e2e-tests:
needs: integration-tests
Expand All @@ -65,7 +65,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: aws/aws-durable-execution-sdk-python-testing
path: testing-sdk
path: language-sdk/packages/testing-sdk

- name: Set up Python 3.13
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
Expand All @@ -84,7 +84,7 @@ jobs:

- name: Get integration examples
id: get-examples
working-directory: language-sdk/examples
working-directory: language-sdk/packages/aws-durable-execution-sdk-python-examples
run: |
echo "examples=$(jq -c '.examples | map(select(.integration == true)) | .[0:2]' examples-catalog.json)" >> $GITHUB_OUTPUT

Expand All @@ -97,7 +97,7 @@ jobs:
rm -rf /tmp/aws/

- name: Deploy and test examples
working-directory: language-sdk
working-directory: language-sdk/packages/aws-durable-execution-sdk-python-examples
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
LAMBDA_ENDPOINT: "https://lambda.us-west-2.amazonaws.com"
Expand Down
50 changes: 29 additions & 21 deletions .github/workflows/pypi-publish.yml
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I haven't actually tested this one but it looks quite reasonable. I had to work a little more closely with AI on this one.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will upload a Python Package to PyPI when a release is created
# This workflow will upload Python Packages to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
Expand All @@ -18,59 +18,67 @@ permissions:
jobs:
release-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- name: aws-durable-execution-sdk-python
path: packages/aws-durable-execution-sdk-python
- name: aws-durable-execution-sdk-python-otel
path: packages/aws-durable-execution-sdk-python-otel

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

with:
ref: ${{ github.event.release.tag_name }}
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
- name: Install Hatch
run: |
python -m pip install --upgrade hatch==1.16.5

- name: Install Hatch
run: python -m pip install --upgrade hatch==1.16.5

- name: Build release distributions
run: |
# NOTE: put your own distribution build steps here.
hatch build
working-directory: ${{ matrix.package.path }}
run: hatch build

- name: Upload distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: release-dists
path: dist/
name: release-dists-${{ matrix.package.name }}
path: ${{ matrix.package.path }}/dist/

pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
strategy:
fail-fast: false
matrix:
package:
- name: aws-durable-execution-sdk-python
- name: aws-durable-execution-sdk-python-otel
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

# Dedicated environments with protections for publishing are strongly recommended.
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
environment:
name: pypi
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
# url: https://pypi.org/p/aws-durable-execution-sdk-python
#
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
# ALTERNATIVE: exactly, uncomment the following line instead:
url: https://pypi.org/project/aws-durable-execution-sdk-python/${{ github.event.release.name }}
url: https://pypi.org/project/${{ matrix.package.name }}/${{ github.event.release.name }}

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: release-dists
name: release-dists-${{ matrix.package.name }}
path: dist/

- name: Publish release distributions to PyPI
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
packages-dir: dist/

notify-release:
if: always() && contains(needs.pypi-publish.result, 'success')
needs: [pypi-publish]
uses: ./.github/workflows/notify-release.yml
with:
Expand Down
72 changes: 0 additions & 72 deletions .github/workflows/sync-package.yml

This file was deleted.

Loading