diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e69d223..7a6399b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bf4d751 --- /dev/null +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 36c7617..793ed06 100644 --- a/README.md +++ b/README.md @@ -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. ---