2fas-server/Makefile

48 lines
1.5 KiB
Makefile
Raw Normal View History

2022-12-31 10:22:38 +01:00
.PHONY: help
USERID=$(shell id -u)
help:
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
migration: ## create database migrations file
docker compose run -u ${USERID}:${USERID} --rm api migrate create new_migration sql
2022-12-31 10:22:38 +01:00
migration-up: ## apply all available migrations
docker compose run -u ${USERID}:${USERID} --rm api migrate up
2022-12-31 10:22:38 +01:00
2024-03-16 15:41:30 +01:00
.PHONY: up
2022-12-31 10:22:38 +01:00
up: ## run all applications in stack
docker compose build
docker compose up -d
2022-12-31 10:22:38 +01:00
2024-03-16 15:41:30 +01:00
.PHONY: unit-tests
2024-04-04 13:46:23 +02:00
unit-tests: ## run unit tests without e2e-tests directory.
2024-03-16 15:41:30 +01:00
go test -race -count=1 `go list ./... | grep -v e2e-tests`
2022-12-31 10:22:38 +01:00
2024-04-04 13:46:23 +02:00
.PHONY: unit-tests-ci
unit-tests-ci: ## run unit tests without e2e-tests directory (multiple times to find race conditions).
go test -race -count=50 -failfast `go list ./... | grep -v e2e-tests`
2024-03-16 15:41:30 +01:00
.PHONY: ci-e2e
ci-e2e: up
go run ./e2e-tests/scripts/wait-ready/main.go -addr=':80;:8081;:8082'
@$(MAKE) tests-e2e
2022-12-31 10:22:38 +01:00
2024-03-16 15:41:30 +01:00
.PHONY: tests-e2e
2022-12-31 10:22:38 +01:00
tests-e2e: ## run end to end tests
2023-05-29 20:03:01 +02:00
## There is some race condition when running tests as go test -count=1 ./tests/... Come back at some point and fix it
2024-03-16 15:41:30 +01:00
go test ./e2e-tests/browser_extension/... -count=1
go test ./e2e-tests/icons/... -count=1
go test ./e2e-tests/mobile/... -count=1
go test ./e2e-tests/support/... -count=1
go test ./e2e-tests/system/... -count=1
2023-01-31 10:05:54 +01:00
vendor-licenses: ## report vendor licenses
2024-04-04 13:46:23 +02:00
go-licenses report ./cmd/api --template licenses.tpl > licenses.json 2> licenses-errors