~seirdy/seirdy.one

seirdy.one/Makefile.online -rw-r--r-- 3.0 KiB
5b4ed2ffRohan Kumar Add more accounts 8 days ago
                                                                                
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
# The following test the online instance, post-deploy. I just kept them here for convenience

include Makefile
DOMAIN = seirdy.one
PAGE_PATH = /
SCHEME=https://
URL ?= $(SCHEME)$(DOMAIN)$(PAGE_PATH)
# latest bleeding-edge chromium snapshot
CHROME_DIR = /home/rkumar/Downloads/gitclone/chromium/thorium/latest
CHROME_PATH = $(CHROME_DIR)/thorium
CHROMEDRIVER_PATH = $(CHROME_DIR)/chromedriver
CHROME_PROFILE ?= /tmp/chrome-lighthouse
JS_FLAGS=''
# We enable experimental web platform features so the Document-Policy header is enforced
# # 
CHROME_FLAGS += --headless --disable-extensions --no-default-browser-check --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-device-discovery-notifications --disable-domain-reliability --disable-background-timer-throttling --disable-breakpad --enable-blink-features=LayoutInstabilityAPI --enable-features=UseDnsHttpsSvcb,UseDnsHttpsSvcbAlpn --no-first-run --disable-background-networking --user-data-dir=$(CHROME_PROFILE) --enable-experimental-web-platform-features --enable-quic --origin-to-force-quic-on=staging.seirdy.one:443
CHROME_FLAGS_COMMA = 'disable-extensions,no-default-browser-check,disable-client-side-phishing-detection,disable-component-update,disable-default-apps,disable-device-discovery-notifications,disable-domain-reliability,disable-background-timer-throttling,disable-breakpad,no-first-run,disable-background-networking,js-flags=--jitless'
# When quiet, my lappie's CPU power is benchmarked to be ~1320. The CPU throttling calculator recommends throttling by 3.1x.
# Multiply that by 4 cuz imo it's way too generous. It targets devices like the Moto G4; I target devices like the JioPhone 2.
CPU_SLOWDOWN=12.5
LIGHTHOUSE_ARGS += --budget-path linter-configs/budget.json --output html --output json --output-file lighthouse-results --throttling-method=devtools --throttling.cpuSlowdownMultiplier=$(CPU_SLOWDOWN) --chrome-flags="$(CHROME_FLAGS)"

# make some of these quiet bc they'll otherwise echo every URL

hint-online:
	@echo "Running webhint"
	@hint --config linter-configs/hintrc $(URLS)
lighthouse:
	mkdir -p $(CHROME_PROFILE)
	CHROME_PATH=$(CHROME_PATH) CHROME_PROFILE=$(CHROME_PROFILE) JS_FLAGS='' lighthouse $(URLS) $(LIGHTHOUSE_ARGS)
	rm -rf $(CHROME_PROFILE)
redbot:
	redbot_cli -a $(URL)
.PHONY: hint-online lighthouse redbot

axe:
	@echo "Running axe"
	@axe $(URLS) --chrome-options $(CHROME_FLAGS_COMMA) --chromedriver-path=$(CHROMEDRIVER_PATH) --show-errors
axe-ff:
	@echo "Running axe with Firefox"
	@scripts/bin/axe-ff $(OUTPUT_DIR) $(URLS)

.PHONY: axe axe-ff

.validate-feed-main:
	scripts/bin/validate-feed $(HUGO_BASEURL)atom.xml
.validate-feed-posts:
	scripts/bin/validate-feed $(HUGO_BASEURL)posts/atom.xml
.validate-feed-notes:
	scripts/bin/validate-feed $(HUGO_BASEURL)notes/atom.xml
validate-feeds: .validate-feed-main .validate-feed-posts .validate-feed-notes
.PHONY: validate-feeds .validate-feed-main .validate-feed-posts .validate-feed-notes

.PHONY: all-extra
all-extra: axe-ff htmltest validate-json equal-access htmlproofer lint-css validate-feeds