diff --git a/.circleci/config.yml b/.circleci/config.yml index 187fbc80bb..985473b806 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,6 +96,12 @@ executors: environment: XTASK_TARGET: "x86_64-unknown-linux-gnu" + node_js: + docker: + - image: node:lts + resource_class: medium + + tag_matches_prerelease: &tag_matches_prerelease matches: pattern: "^.*(beta|alpha|rc|prerelease|draft|test).*$" @@ -143,6 +149,11 @@ workflows: platform: [amd_ubuntu] rust_channel: [stable] command: [integration-test] + - install_js: + name: Test installation for Javascript Package Managers (<< matrix.package_manager >>) + matrix: + parameters: + package_manager: [npm, npm_global, pnpm] release: jobs: - xtask: @@ -272,6 +283,21 @@ jobs: - gh_release - npm_publish + install_js: + parameters: + package_manager: + type: enum + enum: ["npm", "npm_global", "pnpm"] + executor: node_js + steps: + - checkout: + path: "rover" + - run: + name: "Invoke Install Scripts" + command: | + cd rover/.circleci/scripts + ./install_<< parameters.package_manager >>.sh + # reusable command snippets can be referred to in any `steps` object commands: setup: diff --git a/.circleci/scripts/install_npm.sh b/.circleci/scripts/install_npm.sh new file mode 100755 index 0000000000..ea7cddae99 --- /dev/null +++ b/.circleci/scripts/install_npm.sh @@ -0,0 +1,16 @@ +#! /bin/bash +set -euo pipefail + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +mkdir /test +cd /test +echo "Created test directory" +npm init -y +echo "Initialised new npm package" +npm install --install-links=true "$SCRIPT_DIR/../../installers/npm" +echo "Installed rover as local npm package" +cd node_modules/.bin/ +echo "Checking version" +./rover --version +echo "Checked version, all ok!" \ No newline at end of file diff --git a/.circleci/scripts/install_npm_global.sh b/.circleci/scripts/install_npm_global.sh new file mode 100755 index 0000000000..a3d6662764 --- /dev/null +++ b/.circleci/scripts/install_npm_global.sh @@ -0,0 +1,14 @@ +#! /bin/bash +set -euo pipefail + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +mkdir /test +cd /test +echo "Created test directory" +npm install --install-links=true -g "$SCRIPT_DIR/../../installers/npm" +echo "Installed rover as global npm package" +cd /usr/local/bin/ +echo "Checking version" +./rover --version +echo "Checked version, all ok!" \ No newline at end of file diff --git a/.circleci/scripts/install_pnpm.sh b/.circleci/scripts/install_pnpm.sh new file mode 100755 index 0000000000..ec0ccec647 --- /dev/null +++ b/.circleci/scripts/install_pnpm.sh @@ -0,0 +1,18 @@ +#! /bin/bash +set -euo pipefail + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + + +mkdir /test +cd /test +echo "Created test directory" +npm install -g pnpm@v9.3.0 +echo "Installed pnpm" +pnpm init +pnpm add "file:$SCRIPT_DIR/../../installers/npm" +echo "Installed rover as pnpm package" +cd node_modules/.bin/ +echo "Checking version" +./rover --version +echo "Checked version, all ok!" \ No newline at end of file