diff --git a/build/sparse-profiles/taskgraph b/build/sparse-profiles/taskgraph index 485ec7ec44a1..c715a130157f 100644 --- a/build/sparse-profiles/taskgraph +++ b/build/sparse-profiles/taskgraph @@ -37,6 +37,14 @@ path:package.json path:package-lock.json path:tools/lint/ +# for other node toolchain packaging +path:browser/extensions/newtab/package.json +path:browser/extensions/newtab/package-lock.json +path:browser/components/aboutwelcome/package.json +path:browser/components/aboutwelcome/package-lock.json +path:browser/components/asrouter/package.json +path:browser/components/asrouter/package-lock.json + # for new-style try pushes path:try_task_config.json diff --git a/taskcluster/kinds/source-test/node.yml b/taskcluster/kinds/source-test/node.yml index 131bdc347d99..a5347c60ded6 100644 --- a/taskcluster/kinds/source-test/node.yml +++ b/taskcluster/kinds/source-test/node.yml @@ -33,14 +33,14 @@ newtab-unit-tests: - target.tar.xz toolchain: - linux64-node + - node-modules + - newtab-node-modules run: command: > cd /builds/worker/checkouts/gecko && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/node_modules node_modules && cd /builds/worker/checkouts/gecko/browser/extensions/newtab && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/newtab/node_modules node_modules && FIREFOX_BIN=$MOZ_FETCHES_DIR/firefox/firefox node bin/try-runner.js when: files-changed: @@ -66,14 +66,14 @@ newtab-unit-tests-ccov: - target.tar.xz toolchain: - linux64-node + - node-modules + - newtab-node-modules run: command: > cd /builds/worker/checkouts/gecko && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/node_modules node_modules && cd /builds/worker/checkouts/gecko/browser/extensions/newtab && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/newtab/node_modules node_modules && FIREFOX_BIN=$MOZ_FETCHES_DIR/firefox/firefox node bin/try-runner.js # This should only run on mozilla-central, as the bot will only parse mozilla-central # coverage anyways. @@ -94,17 +94,19 @@ messagingsystem-unit-tests: linux1804-64/opt: build-linux64/opt default: linux1804-64/opt: build-linux64-shippable/opt + fetches: + toolchain: + - node-modules + - aboutwelcome-node-modules + - asrouter-node-modules run: command: > cd /builds/worker/checkouts/gecko && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/node_modules node_modules && cd /builds/worker/checkouts/gecko/browser/components/aboutwelcome && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/aboutwelcome/node_modules node_modules && cd /builds/worker/checkouts/gecko/browser/components/asrouter && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/asrouter/node_modules node_modules && node bin/try-runner.js when: files-changed: @@ -126,17 +128,19 @@ messagingsystem-unit-tests-ccov: linux1804-64/opt: build-linux64/opt default: linux1804-64/opt: build-linux64-shippable/opt + fetches: + toolchain: + - node-modules + - aboutwelcome-node-modules + - asrouter-node-modules run: command: > cd /builds/worker/checkouts/gecko && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/node_modules node_modules && cd /builds/worker/checkouts/gecko/browser/components/aboutwelcome && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/aboutwelcome/node_modules node_modules && cd /builds/worker/checkouts/gecko/browser/components/asrouter && - rm -rf node_modules && - npm ci && + cp -r $MOZ_FETCHES_DIR/asrouter/node_modules node_modules && node bin/try-runner.js # This should only run on mozilla-central, as the bot will only parse mozilla-central # coverage anyways. diff --git a/taskcluster/kinds/toolchain/misc.yml b/taskcluster/kinds/toolchain/misc.yml index 95fbdf380ffb..6e3e68d46542 100644 --- a/taskcluster/kinds/toolchain/misc.yml +++ b/taskcluster/kinds/toolchain/misc.yml @@ -407,6 +407,38 @@ browsertime: toolchain: - linux64-node +aboutwelcome-node-modules: + description: "npm install aboutwelcome node_modules" + treeherder: + symbol: TL(aboutwelcome-node) + run: + script: generic-node-modules.sh + arguments: ['aboutwelcome', 'browser/components/aboutwelcome/'] + sparse-profile: null + resources: + - 'browser/components/aboutwelcome/package.json' + - 'browser/components/aboutwelcome/package-lock.json' + toolchain-artifact: public/build/aboutwelcome-node-modules.tar.zst + fetches: + toolchain: + - linux64-node + +asrouter-node-modules: + description: "npm install asrouter node_modules" + treeherder: + symbol: TL(asrouter-node) + run: + script: generic-node-modules.sh + arguments: ['asrouter', 'browser/components/asrouter/'] + sparse-profile: null + resources: + - 'browser/components/asrouter/package.json' + - 'browser/components/asrouter/package-lock.json' + toolchain-artifact: public/build/asrouter-node-modules.tar.zst + fetches: + toolchain: + - linux64-node + eslint-plugin-mozilla: description: "npm install eslint-plugin-mozilla node_modules" treeherder: @@ -422,6 +454,23 @@ eslint-plugin-mozilla: toolchain: - linux64-node + +newtab-node-modules: + description: "npm install newtab node_modules" + treeherder: + symbol: TL(newtab-node) + run: + script: generic-node-modules.sh + arguments: ['newtab', 'browser/extensions/newtab/'] + sparse-profile: null + resources: + - 'browser/extensions/newtab/package.json' + - 'browser/extensions/newtab/package-lock.json' + toolchain-artifact: public/build/newtab-node-modules.tar.zst + fetches: + toolchain: + - linux64-node + node-modules: description: "npm install top-level node_modules" treeherder: diff --git a/taskcluster/scripts/misc/generic-node-modules.sh b/taskcluster/scripts/misc/generic-node-modules.sh new file mode 100755 index 000000000000..85ceab5a91d3 --- /dev/null +++ b/taskcluster/scripts/misc/generic-node-modules.sh @@ -0,0 +1,20 @@ +#!/bin/bash -vex + +set -x -e + +echo "running as" $(id) + +set -v + +cd $GECKO_PATH + +export PATH=$PATH:$MOZ_FETCHES_DIR/node/bin + +rm -rf $2/node_modules +npm ci --prefix $2 + +# We have $2/{node_modules,...} and want $1/{node_modules}. +mkdir -p /builds/worker/artifacts +cd $2 +cd .. +tar caf /builds/worker/artifacts/$1-node-modules.tar.zst $1/node_modules