From e989ff01c43c9502929702ced6b6360b7ed6ac8b Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 23 Dec 2020 17:12:40 -0800 Subject: [PATCH] CI: don't install packages globally Install bins into ~/bin instead and use local npm packages --- .build.yml | 7 ++++--- .gitignore | 5 +++-- .lighthouserc.yml | 1 + Makefile | 4 ++-- package.json | 21 +++++++++++++++++++++ 5 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 package.json diff --git a/.build.yml b/.build.yml index 17c80b9..ac4cef2 100644 --- a/.build.yml +++ b/.build.yml @@ -19,10 +19,11 @@ tasks: - deps: | echo "StrictHostKeyChecking=no" >> ~/.ssh/config rsync deploy@seirdy.one:/home/deploy/binaries.tar.gz . - tar x -ozC /bin -f binaries.tar.gz - npm i -g npm pnpm - pnpm i -g @lhci/cli hint @hint/configuration-web-recommended @hint/hint-doctype @hint/hint-https-only @hint/hint-performance-budget @hint/formatter-codeframe + mkdir -p ~/bin + tar x -ozC ~/bin -f binaries.tar.gz - build_deploy: | cd seirdy.one + npm i -D + export PATH=~/bin:$PATH make DOMAIN=staging.seirdy.one test-staging make clean deploy diff --git a/.gitignore b/.gitignore index f4ad510..d07a591 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ hint-report/ .hintrc-* *.report.html *.report.json -.lighthouseci -lighthouse-reports +.lighthouseci/* +lighthouse-reports/* +node_modules/* diff --git a/.lighthouserc.yml b/.lighthouserc.yml index 1362333..cb35eda 100644 --- a/.lighthouserc.yml +++ b/.lighthouserc.yml @@ -19,6 +19,7 @@ ci: works-offline: "off" # not a PWA. Use caching. is-crawlable: "off" # staging server won't be indexed timing-budget: "off" # buggy; manually use the below assertions instead + canonical: "off" # staging server doesn't have canonical speed-index: - warn - maxNumericValue: 3000 diff --git a/Makefile b/Makefile index 8849f14..b25e83b 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,8 @@ deploy: deploy-html deploy-gemini ## stuff for the staging server .PHONY: test-staging test-staging: deploy-html - yq e '.ci .collect .url | .[]' .lighthouserc.yml | xargs hint -f codeframe - lhci autorun + yq e '.ci .collect .url | .[]' .lighthouserc.yml | xargs npx hint -f codeframe + npx lhci autorun .PHONY: all all: test deploy diff --git a/package.json b/package.json new file mode 100644 index 0000000..15a7c86 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "seirdy.one", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git@git.sr.ht:~seirdy/seirdy.one" + }, + "author": "", + "license": "MIT", + "devDependencies": { + "@hint/configuration-web-recommended": "^8.1.0", + "@hint/formatter-codeframe": "^3.1.19", + "@hint/hint-doctype": "^3.3.7", + "@hint/hint-https-only": "^2.4.7", + "@hint/hint-performance-budget": "^2.4.7", + "@lhci/cli": "^0.6.1", + "hint": "^6.1.1" + } +}