This repository was archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 1.33 KB
/
Makefile
File metadata and controls
39 lines (28 loc) · 1.33 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
# the repos in the fixtures directory are user facing,
# which makes n-gage think it itself is user facing
IGNORE_A11Y = true
include index.mk
unit-test:
mocha --recursive "./test/{,!(fixtures)/**/}*.test.js"
install:
npm install --no-package-lock
test: unit-test integration-test
fixture-base = test/fixtures
fixture-repos = next-service-registry next-myft-email n-tracking # app, lambda, component
fixture-targets = $(addprefix integration-test-, $(fixture-repos))
fixture-folders = $(addprefix $(fixture-base)/, $(fixture-repos))
ngage-path = $(realpath index.mk)
git-clone-base = $(if $(GITHUB_AUTH_TOKEN), https://$(GITHUB_AUTH_TOKEN)@github.com/financial-times, git@github.com:financial-times)
$(fixture-base)/%:
@git clone --depth 1 $(git-clone-base)/$* $@
integration-test-%: $(fixture-base)/%
# edit the fixture's makefile to point at us, not n-gage from node_modules
sed -i'.bak' "s:-include node_modules/@financial-times/n-gage/index.mk:include $(ngage-path):" $</Makefile
# run a handful of standard next make commands in the fixture folder using the `-C DIRECTORY` option
npm_config_ignore_scripts=true $(MAKE) -C $< install build
# ensure the folders have some basic things we would expect from install
[ -d $</node_modules ]
[ -f $</.editorconfig ]
integration-test: $(fixture-targets)
clean-fixtures:
rm -rf $(fixture-folders)