Skip to content
Closed
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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,29 @@ jobs:
- name: Run pytest
# moto mocks DynamoDB — no AWS credentials required
run: PYTHONPATH=. pytest tests/test_exclusao.py -v

synth:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: cdk/requirements.txt

- uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install CDK Python deps
run: pip install -r cdk/requirements.txt

- name: CDK synth
# No deploy; placeholder account/region — no AWS credentials
env:
CDK_DEFAULT_ACCOUNT: "111111111111"
CDK_DEFAULT_REGION: us-east-1
AWS_DEFAULT_REGION: us-east-1
run: npx --yes aws-cdk@2 synth
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: check test synth

# Same pytest command as CI job `test`
test:
PYTHONPATH=. pytest tests/test_exclusao.py -v

# Requires: pip install -r cdk/requirements.txt + Node (npx)
synth:
npx --yes aws-cdk@2 synth

check: test synth
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ PYTHONPATH=. pytest tests/test_exclusao.py -v

Usa **moto** (sem AWS real). O pacote `lambda/` importa via `importlib` (nome reservado).

CI (GitHub Actions): mesmo comando em Python 3.12 em todo PR/`push` na `main` — sem credenciais AWS no runner.
CI (GitHub Actions): job `test` (pytest+moto, Python 3.12) e job `synth` (`npx aws-cdk@2 synth`, sem deploy) em todo PR/`push` na `main` — sem credenciais AWS no runner.

### Check local

```bash
pip install -r requirements.txt -r cdk/requirements.txt
make check # pytest (igual ao CI) + npx aws-cdk@2 synth (sem deploy)
```

Requer Node (para `npx`). Só `make test` ou `make synth` se quiser isolar.

---

Expand Down
Loading