-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathMakefile
45 lines (35 loc) · 1.05 KB
/
Makefile
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
DOCKER ?= docker
EXAMPLES = node esbuild parcel parcel_packageExports vite webpack
EXAMPLES_DIR = $(addprefix examples/,$(EXAMPLES))
NODE_MODULES_TARGETS = $(addsuffix /node_modules,$(EXAMPLES_DIR))
%/node_modules: evmole.latest.tgz
@echo "Installing dependencies in $(@D) $@"
npm --prefix $(@D) install --no-save
touch $@
evmole-%.tgz:
npm run build
npm pack
evmole.latest.tgz: evmole-%.tgz
ln -f -s evmole-*.tgz evmole.latest.tgz
test: evmole.latest.tgz $(NODE_MODULES_TARGETS)
for dir in $(EXAMPLES_DIR); do \
npm --prefix $$dir install --force --no-save ./evmole.latest.tgz; \
done
node examples/node/with_import.mjs
node examples/node/with_require.cjs
ifeq ($(GITHUB_ACTIONS),true)
cd tests && npx playwright test
else
$(DOCKER) run --network=none --rm \
-v $(shell pwd)/:/mnt \
-it mcr.microsoft.com/playwright:v1.49.0-jammy \
/bin/bash -c \
'cd /mnt/tests && npx playwright test'
endif
clean:
rm -f *.tgz
for dir in $(EXAMPLES_DIR); do \
rm -rf $$dir/node_modules; \
rm -rf $$dir/dist; \
rm -rf $$dir/.parcel-cache; \
done