Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
145 lines (119 loc) · 3.23 KB
/
Copy pathMakefile
File metadata and controls
145 lines (119 loc) · 3.23 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
PROJECT = rebar3_lfe
ROOT_DIR = $(shell pwd)
SYS_TEST_DIR = /tmp/rebar3_lfe/_integration/_testing
GLOBAL_INSTALL_DIR = ~/.config/rebar3/plugins
GLOBAL_INSTALL = $(GLOBAL_INSTALL_DIR)/$(PROJECT)
.PHONY: all compile clean check test coverage benchmarks smoke-tests test-format-e2e ci
all: compile
compile:
@rebar3 compile
clean:
@rm -rf _build rebar.lock $(SYS_TEST_DIR) $(GLOBAL_INSTALL) ebin test/*.beam
check: clean
@rebar3 compile
@rebar3 xref
@rebar3 dialyzer
@rebar3 as test proper -c
@rebar3 as test ct
@rebar3 as test cover -v
test: clean
@rebar3 as test ct
-@rebar3 as test proper -c
coverage: clean
@rebar3 as test do ct, cover -v
benchmarks: compile
@rebar3 shell --eval "r3lfe_benchmarks:run_all(), init:stop()."
# Quality checks
xref:
@rebar3 xref
dialyzer:
@rebar3 dialyzer
quality: xref dialyzer
# CI/CD helper
ci: clean compile quality test coverage
# Publish to hex.pm
publish: clean
@echo "\nPublishing to hex.pm ...\n"
@rebar3 hex publish package
$(SYS_TEST_DIR):
mkdir -p $(SYS_TEST_DIR)
cp priv/testing/rebar.config $(SYS_TEST_DIR)/rebar.config
$(GLOBAL_INSTALL_DIR):
mkdir -p $(GLOBAL_INSTALL_DIR)
setup: $(SYS_TEST_DIR)
setup: $(SYS_TEST_DIR)
-git branch -D integration-testing
git checkout -b integration-testing
@git fetch origin
@if git rev-parse --verify origin/integration-testing >/dev/null 2>&1; then \
LOCAL=$$(git rev-parse integration-testing); \
REMOTE=$$(git rev-parse origin/integration-testing); \
if [ "$$LOCAL" = "$$REMOTE" ]; then \
echo "Remote branch is already up to date"; \
else \
echo "Remote branch differs, force pushing..."; \
git push origin integration-testing -f; \
fi \
else \
echo "Remote branch doesn't exist, creating..."; \
git push origin integration-testing; \
fi
git switch -
test-new: clean setup
rebar3 compile
cd $(SYS_TEST_DIR) && \
rebar3 new
test-new-lfe-lib: clean setup
rebar3 compile
cd $(SYS_TEST_DIR) && \
rebar3 compile && \
rebar3 new lfe-lib example-lib && \
cd example-lib && \
rebar3 compile
test-new-lfe-main: clean setup
rebar3 compile
cd $(SYS_TEST_DIR) && \
rebar3 compile && \
rebar3 new lfe-main example-main && \
cd example-main && \
rebar3 compile && \
rebar3 lfe run -- 42
test-new-lfe-app: clean setup
rebar3 compile
cd $(SYS_TEST_DIR) && \
rebar3 compile && \
rebar3 new lfe-app example-app && \
cd example-app && \
rebar3 compile
test-new-lfe-escript: clean setup
rebar3 compile
cd $(SYS_TEST_DIR) && \
rebar3 compile && \
rebar3 new lfe-escript example-escript && \
cd example-escript && \
rebar3 compile && \
rebar3 lfe escriptize && \
rebar3 lfe run-escript 1 2 5
test-new-lfe-release: clean setup
rebar3 compile
cd $(SYS_TEST_DIR) && \
rebar3 compile && \
rebar3 new lfe-release example-release && \
cd example-release && \
rebar3 compile && \
rebar3 lfe release
test-versions-cmd: clean setup
rebar3 compile
cd $(SYS_TEST_DIR) && \
rebar3 compile && \
rebar3 lfe versions
test-clean-cmd: clean setup
rebar3 compile
cd $(SYS_TEST_DIR) && \
rebar3 compile && \
rebar3 lfe clean
test-format-e2e:
@bash test/e2e/format_e2e.sh
smoke-tests: test-new test-new-lfe-lib test-new-lfe-main \
test-new-lfe-app test-new-lfe-escript test-new-lfe-release \
test-versions-cmd test-clean-cmd test-format-e2e