-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (56 loc) · 1.84 KB
/
Makefile
File metadata and controls
68 lines (56 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
COMPOSE ?= docker compose
TARGET_HEADER = @echo -e '===== \e[34m' $@ '\e[0m'
UID ?= $(shell id -u)
GID ?= $(shell id -g)
YARN_NODE = UID=$(UID) GID=$(GID) $(COMPOSE) run --rm --no-deps node yarn
YARN_PLAYWRIGHT = UID=$(UID) GID=$(GID) $(COMPOSE) run --rm --no-deps playwright yarn
.PHONY: help
help: ## Show available recipes
@cat $(MAKEFILE_LIST) | grep -e "^[a-zA-Z0-9_\-]*: *.*## *" | awk '\
BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}'
.PHONY: node_modules
node_modules: package.json yarn.lock ## Install dependencies in the node container
$(TARGET_HEADER)
@$(YARN_NODE) install --silent
@touch node_modules || true
.PHONY: lint
lint: ## Run ESLint in the node container
$(TARGET_HEADER)
$(YARN_NODE) lint
.PHONY: build
build: ## Build the package in the node container
$(TARGET_HEADER)
$(YARN_NODE) build
.PHONY: typecheck
typecheck: ## Run TypeScript typecheck in the node container
$(TARGET_HEADER)
$(YARN_NODE) typecheck
.PHONY: test
test: ## Run unit and E2E tests in containers
$(TARGET_HEADER)
$(YARN_NODE) test:unit
$(YARN_PLAYWRIGHT) test:e2e
.PHONY: test-unit
test-unit: ## Run unit tests in the node container
$(TARGET_HEADER)
$(YARN_NODE) test:unit
.PHONY: test-e2e
test-e2e: ## Run Playwright-backed E2E tests in the browser container
$(TARGET_HEADER)
$(YARN_PLAYWRIGHT) test:e2e
.PHONY: coverage
coverage: ## Run full merged coverage in the browser container
$(TARGET_HEADER)
$(YARN_PLAYWRIGHT) coverage
.PHONY: coverage-unit
coverage-unit: ## Run unit coverage in the node container
$(TARGET_HEADER)
$(YARN_NODE) coverage:unit
.PHONY: coverage-e2e
coverage-e2e: ## Run E2E coverage in the browser container
$(TARGET_HEADER)
$(YARN_PLAYWRIGHT) coverage:e2e
.PHONY: coverage-merge
coverage-merge: ## Merge raw coverage with nyc in the node container
$(TARGET_HEADER)
$(YARN_NODE) coverage:merge