forked from jenkins-infra/evergreen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
node.mk
32 lines (22 loc) · 855 Bytes
/
node.mk
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
# Clever: https://stackoverflow.com/a/324782
NODE:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/tools/node
all:: check
lint:: depends
$(NODE) npm run eslint
fix-formatting: depends
$(NODE) npm run eslint -- --fix
check:: lint
$(MAKE) unit
unit:: depends
if [ -z "$${SKIP_TESTS}" ]; then $(NODE) npm run test; \
else echo "Tests are skipped!"; fi;
debug-unit: depends
$(NODE) node --inspect-brk=0.0.0.0:9229 node_modules/.bin/jest --runInBand --bail --forceExit test/
depends: node_modules
node_modules: package-lock.json package.json
# Checking to see if the directory exists because npm install updates the
# directory every time it runs, busting the GNU/Make cache causing rebuilds
if [ ! -d node_modules ]; then $(NODE) npm ci; fi;
clean::
rm -rf vendor node_modules build
.PHONY: all check clean depends run unit lint