feat: implement AWS Lambda compatible JSON logging #145
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: CI/CD Pipeline | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: read | |
checks: write | |
pull-requests: write | |
jobs: | |
lint: | |
name: Lint and Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Python | |
uses: actions/setup-python@v6 | |
with: | |
python-version: '3.10' | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
# Add virtual environment creation | |
- name: Create virtual environment | |
run: uv venv | |
- name: Install dependencies with uv | |
run: | | |
uv sync --dev | |
- name: Run pre-commit | |
run: uv run pre-commit run --all-files | |
test: | |
name: Test Python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v6 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
# Add virtual environment creation | |
- name: Create virtual environment | |
run: uv venv | |
- name: Install dependencies with uv | |
run: | | |
uv sync --dev | |
- name: Run tests with coverage | |
run: | | |
uv run pytest tests/ --cov=src --cov-report=xml --cov-report=html --cov-precision=2 | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: false | |
build: | |
name: Build Distribution | |
runs-on: ubuntu-latest | |
needs: [lint, test] | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Python | |
uses: actions/setup-python@v6 | |
with: | |
python-version: '3.10' | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
# Add virtual environment creation | |
- name: Create virtual environment | |
run: uv venv | |
- name: Build package with uv | |
run: | | |
uv build | |
- name: Check package | |
run: | | |
uv pip install twine | |
uv run twine check dist/* | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
test-install: | |
name: Test Package Installation | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v6 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Download artifacts | |
uses: actions/download-artifact@v5 | |
with: | |
name: dist | |
path: dist/ | |
- name: Install from wheel | |
run: | | |
pip install dist/*.whl | |
python -c "from bedrock_agentcore import BedrockAgentCoreApp; print('Import successful')" |