.PHONY: build build_test lint_and_test integration_test

build:
	docker compose build function

build_test:
	docker compose build lint-and-test

lint_and_test:
	docker compose run --rm lint-and-test

# Runs the PostgreSQL integration tests against throwaway local postgres
# containers. Excluded from lint_and_test / the CI build. Always tears down,
# even when the test run fails, then re-exits with the test's status.
integration_test:
	docker compose run --rm --build integration-test; \
	status=$$?; \
	docker compose down; \
	exit $$status
