-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathMakefile
More file actions
199 lines (173 loc) · 6.27 KB
/
Makefile
File metadata and controls
199 lines (173 loc) · 6.27 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
git:
git submodule update --init --recursive
setup: git package.json
npm install
setupnpm:
npm install
PROD_OPTIONS=-e production --config config.toml,config_prod.toml --minify
DEV_OPTIONS=-e development --config config.toml,config_dev.toml
LOCAL_OPTIONS=-e development --config config.toml,config_local.toml
PR_OPTIONS=-D $(PROD_OPTIONS) --config config.toml,config_pr.toml
SERVE_OPTIONS=--baseURL http://localhost
clean:
rm -rf public resources dist
purge:
npm cache clean --force && hugo mod clean --all && rm -rf public resources dist node_modules themes/docsy/* themes/docsy/.[a-zA-Z0-9]* .hugo_build.lock
build-prod: clean setup
hugo $(PROD_OPTIONS)
build-dist: clean setup
hugo $(LOCAL_OPTIONS) -d dist
build-dist-pr: setupnpm
hugo $(LOCAL_OPTIONS) -d dist
htmltest: clean setup
hugo $(LOCAL_OPTIONS) -d dist
htmltest
htmltest-fast: setup
hugo $(LOCAL_OPTIONS) -d dist
htmltest
coveragetest:
python3 .github/workflows/update_sdk_methods.py --coverage -vv
markdowntest:
markdownlint --config .markdownlint.yaml
flake8test:
flake8-markdown docs/**/*.md
build-pr: clean setup
hugo $(PR_OPTIONS)
build-pr-no-clean: setupnpm
hugo $(PR_OPTIONS)
serve-prod: setup
hugo server $(PROD_OPTIONS) $(SERVE_OPTIONS)
serve-prod-draft: setup
hugo server -D $(PROD_OPTIONS) $(SERVE_OPTIONS)
serve-prod-future: setup
hugo server -F $(PROD_OPTIONS) $(SERVE_OPTIONS)
serve-dev: setup
hugo server $(DEV_OPTIONS) $(SERVE_OPTIONS)
serve-dev-draft: setup
hugo server -D $(DEV_OPTIONS) $(SERVE_OPTIONS)
serve-dev-future: setup
hugo server -F $(DEV_OPTIONS) $(SERVE_OPTIONS)
prettierfix: setup
./node_modules/prettier/bin/prettier.cjs --check docs/**/*.md --fix --write
test-code-snippets: test-python-snippets test-go-snippets test-typescript-snippets
test-python-snippets:
rm -rf static/include/examples/**/.DS_Store
bluehawk snip -o static/include/examples-generated/ static/include/examples/
@echo "Starting to test Python code samples..."
@echo "========================================"
@total_files=0; \
passed_files=0; \
failed_files=0; \
failed_file_list=""; \
for file in static/include/examples/**/*.py; do \
if [ -f "$$file" ]; then \
echo "Testing: $$file"; \
total_files=$$((total_files + 1)); \
if VIAM_API_KEY="$$VIAM_API_KEY" VIAM_API_KEY_ID="$$VIAM_API_KEY_ID" TEST_ORG_ID="$$TEST_ORG_ID" VIAM_API_KEY_DATA_REGIONS="$$VIAM_API_KEY_DATA_REGIONS" VIAM_API_KEY_ID_DATA_REGIONS="$$VIAM_API_KEY_ID_DATA_REGIONS" python "$$file"; then \
passed_files=$$((passed_files + 1)); \
echo "✅ PASSED: $$file"; \
else \
failed_files=$$((failed_files + 1)); \
echo "❌ FAILED: $$file"; \
if [ -z "$$failed_file_list" ]; then \
failed_file_list="$$file"; \
else \
failed_file_list="$$failed_file_list $$file"; \
fi; \
fi; \
echo "----------------------------------------"; \
fi; \
done; \
echo "========================================"; \
echo "TEST SUMMARY:"; \
echo "Total files tested: $$total_files"; \
echo "Passed: $$passed_files"; \
echo "Failed: $$failed_files"; \
echo "Skipped: $$((total_files - passed_files - failed_files))"; \
if [ $$failed_files -gt 0 ]; then \
echo "Failed files:"; \
for failed_file in $$failed_file_list; do \
echo " - $$failed_file"; \
done; \
fi
test-go-snippets:
rm -rf static/include/examples/**/.DS_Store
bluehawk snip -o static/include/examples-generated/ static/include/examples/
@echo "Starting to test Go code samples..."
@echo "========================================"
@total_files=0; \
passed_files=0; \
failed_files=0; \
failed_file_list=""; \
for file in static/include/examples/**/*.go; do \
if [ -f "$$file" ]; then \
echo "Testing: $$file"; \
total_files=$$((total_files + 1)); \
file_dir=$$(dirname "$$file"); \
if (cd "$$file_dir" && VIAM_API_KEY="$$VIAM_API_KEY" VIAM_API_KEY_ID="$$VIAM_API_KEY_ID" TEST_ORG_ID="$$TEST_ORG_ID" VIAM_API_KEY_DATA_REGIONS="$$VIAM_API_KEY_DATA_REGIONS" VIAM_API_KEY_ID_DATA_REGIONS="$$VIAM_API_KEY_ID_DATA_REGIONS" go run "$$(basename "$$file")"); then \
passed_files=$$((passed_files + 1)); \
echo "✅ PASSED: $$file"; \
else \
failed_files=$$((failed_files + 1)); \
echo "❌ FAILED: $$file"; \
if [ -z "$$failed_file_list" ]; then \
failed_file_list="$$file"; \
else \
failed_file_list="$$failed_file_list $$file"; \
fi; \
fi; \
echo "----------------------------------------"; \
fi; \
done; \
echo "========================================"; \
echo "TEST SUMMARY:"; \
echo "Total files tested: $$total_files"; \
echo "Passed: $$passed_files"; \
echo "Failed: $$failed_files"; \
echo "Skipped: $$((total_files - passed_files - failed_files))"; \
if [ $$failed_files -gt 0 ]; then \
echo "Failed files:"; \
for failed_file in $$failed_file_list; do \
echo " - $$failed_file"; \
done; \
fi
test-typescript-snippets:
rm -rf static/include/examples/**/.DS_Store
bluehawk snip -o static/include/examples-generated/ static/include/examples/
@echo "Starting to test TypeScript code samples..."
@echo "========================================"
@total_files=0; \
passed_files=0; \
failed_files=0; \
failed_file_list=""; \
for file in static/include/examples/**/*.ts; do \
if [ -f "$$file" ]; then \
echo "Testing: $$file"; \
total_files=$$((total_files + 1)); \
if VIAM_API_KEY="$$VIAM_API_KEY" VIAM_API_KEY_ID="$$VIAM_API_KEY_ID" TEST_ORG_ID="$$TEST_ORG_ID" VIAM_API_KEY_DATA_REGIONS="$$VIAM_API_KEY_DATA_REGIONS" VIAM_API_KEY_ID_DATA_REGIONS="$$VIAM_API_KEY_ID_DATA_REGIONS" node "$$file"; then \
passed_files=$$((passed_files + 1)); \
echo "✅ PASSED: $$file"; \
else \
failed_files=$$((failed_files + 1)); \
echo "❌ FAILED: $$file"; \
if [ -z "$$failed_file_list" ]; then \
failed_file_list="$$file"; \
else \
failed_file_list="$$failed_file_list $$file"; \
fi; \
fi; \
echo "----------------------------------------"; \
fi; \
done; \
echo "========================================"; \
echo "TEST SUMMARY:"; \
echo "Total files tested: $$total_files"; \
echo "Passed: $$passed_files"; \
echo "Failed: $$failed_files"; \
echo "Skipped: $$((total_files - passed_files - failed_files))"; \
if [ $$failed_files -gt 0 ]; then \
echo "Failed files:"; \
for failed_file in $$failed_file_list; do \
echo " - $$failed_file"; \
done; \
fi