[actions] use `node/install` instead of `node/run`
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Jordan Harband · committed by Jordan Harband · parent 179d450 · Browse files · 2 files·+32 added−23 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+32 added−23 removed
- tests:+31 added−21 removed
- other:+1 added−2 removed
Provenance
- Commit
9a28dbd- Tree
f774f56- Author
Jordan Harband <ljharb@gmail.com>- Committer
Jordan Harband <ljharb@gmail.com>- Parent
179d450
2 files changed+32 added−23 removed
modified:.github/workflows/tests.yml+1 added-2 removed
56 unmodified lines5758596061616263646566666768699 unmodified lines56 unmodified lines shell: bash - run: sudo ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }} - run: curl --version - run: wget --version - uses: ljharb/actions/node/run@main - uses: ljharb/actions/node/install@main name: 'npm install && version checks' with: node-version: 'lts/*' skip-ls-check: true shell-command: echo installed - run: npm ls urchin - run: npx which urchin - run: env - run: make TERM=xterm-256color TEST_SUITE="${{ matrix.suite }}" SHELL="${{ matrix.shell }}" URCHIN="$(npx which urchin)" test-${{ matrix.shell }}9 unmodified linesmodified:test/fast/Unit tests/nvm_get_arch+31 added-21 removed
1 #!/bin/sh2 3 # Save the PATH as it was when the test started to restore it when it4 # finishes5-ORIG_PATH=$PATH5+ORIG_PATH="${PATH}"6 7 cleanup() {8 # Restore the PATH as it was when the test started9- export PATH=ORIG_PATH9+ export PATH="${ORIG_PATH}"10 }11 12 die () { cleanup; echo "$@" ; exit 1; }13 14 \. ../../../nvm.sh15 16 # Directory where mocked binaries used by nvm_get_arch for each OS/arch are17 # located18-MOCKS_DIR=`pwd`/../../mocks18+MOCKS_DIR="$(pwd)/../../mocks"19 # Sets the PATH for these tests to include the symlinks to the mocked20 # binaries21-export PATH=.:${PATH}21+export PATH=".:${PATH}"22 23 # Setups mock binaries for a given OS and arch that mimic24 # the output of the real binaries used by nvm_get_arch to guess25 # the architecture of a given system.26 setup_mock_arch() {27- local OS=$128- local ARCH=$229- local OPT=$327+ local OS28+ OS=$129+ local ARCH30+ ARCH=$231+ local OPT32+ OPT=$333 31- if [ "_$OS" = "_solaris" ] || [ "_$OS" = "_smartos" ]; then34+ if [ "_${OS}" = '_solaris' ] || [ "_${OS}" = '_smartos' ]; then35 ln -sf "${MOCKS_DIR}/isainfo_${ARCH}" ./isainfo36 if [ "_$OPT" != "_no_pkg_info" ]; then37 ln -sf "${MOCKS_DIR}/pkg_info_${ARCH}" ./pkg_info38 else5 unmodified lines44 }45 46 # Cleans up the setup done by setup_mock_arch.47 cleanup_mock_arch() {45- local OS=$146- local ARCH=$248+ local OS49+ OS=$150+ local ARCH51+ ARCH=$252 48- if [ "_$OS" = "_solaris" ] || [ "_$OS" = "_smartos" ]; then53+ if [ "_${OS}" = '_solaris' ] || [ "_${OS}" = '_smartos' ]; then54 rm -f ./isainfo55 rm -f ./pkg_info56 fi57 3 unmodified lines61 # Runs nvm_get_arch for architecture $ARCH and OS $OS, and compares the62 # expected output $EXPECTED_OUTPUT with the actual output. Does nothing63 # and exits cleanly if they match, dies otherwise.64 run_test() {60- local ARCH=$161- local OS=$262- local EXPECTED_OUTPUT=$363- local OPT=$465+ local ARCH66+ ARCH=$167+ local OS68+ OS=$269+ local EXPECTED_OUTPUT70+ EXPECTED_OUTPUT=$371+ local OPT72+ OPT=$473 65- setup_mock_arch $OS $ARCH $OPT66- local OUTPUT="$(nvm_get_arch)"67- cleanup_mock_arch $OS $ARCH68- [ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] ||69- die "nvm_get_arch for OS \"$OS\" and arch \"$ARCH\" with OPT \"$OPT\" did70- not return \"$EXPECTED_OUTPUT\"; got \"$OUTPUT\""74+ setup_mock_arch "${OS}" "${ARCH}" "${OPT}"75+ local OUTPUT76+ OUTPUT="$(nvm_get_arch)"77+ cleanup_mock_arch "${OS}" "${ARCH}"78+ [ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] ||79+ die "nvm_get_arch for OS \"${OS}\" and arch \"${ARCH}\" with OPT \"${OPT}\" did80+ not return \"${EXPECTED_OUTPUT}\"; got \"${OUTPUT}\""81 }82 83 run_test x86 smartos x8684 run_test x86 smartos x86 no_pkg_info11 unmodified lines