improve Node.js setup on GitHub Actions (#4775)

This commit is contained in:
Alex Lam S.L
2021-03-14 22:25:33 +00:00
committed by GitHub
parent e124ef57e3
commit 4fb54b066f
4 changed files with 36 additions and 56 deletions

View File

@@ -36,20 +36,5 @@ jobs:
- name: Perform uglify, build & test - name: Perform uglify, build & test
shell: bash shell: bash
run: | run: |
git clone --branch v1.6.0 --depth 1 https://github.com/jasongin/nvs.git ~/.nvs . ./test/release/install.sh
while ! timeout 60 bash -c '. ~/.nvs/nvs.sh add $NODE && nvs use $NODE'; do
cd ~/.nvs
while !(git clean -xdf); do echo "'git clean' failed - retrying..."; done
cd -
done
. ~/.nvs/nvs.sh --version
nvs use $NODE
node --version
npm config set audit false
npm config set optional false
npm config set save false
npm config set strict-ssl false
npm config set update-notifier false
npm --version
while !(npm install); do echo "'npm install' failed - retrying..."; done
./test/release/$SCRIPT $OPTIONS ./test/release/$SCRIPT $OPTIONS

View File

@@ -29,20 +29,5 @@ jobs:
- name: Perform tests - name: Perform tests
shell: bash shell: bash
run: | run: |
git clone --branch v1.6.0 --depth 1 https://github.com/jasongin/nvs.git ~/.nvs . ./test/release/install.sh
while ! timeout 60 bash -c '. ~/.nvs/nvs.sh add $NODE && nvs use $NODE'; do
cd ~/.nvs
while !(git clean -xdf); do echo "'git clean' failed - retrying..."; done
cd -
done
. ~/.nvs/nvs.sh --version
nvs use $NODE
node --version
npm config set audit false
npm config set optional false
npm config set save false
npm config set strict-ssl false
npm config set update-notifier false
npm --version
while !(npm install); do echo "'npm install' failed - retrying..."; done
node test/$TYPE node test/$TYPE

View File

@@ -30,33 +30,10 @@ jobs:
NODE: ${{ matrix.node }} NODE: ${{ matrix.node }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install GNU Core Utilities
if: ${{ startsWith(matrix.os, 'macos') }}
env:
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
shell: bash
run: |
while !(brew install coreutils); do echo "'brew install' failed - retrying..."; done
- name: Perform fuzzing - name: Perform fuzzing
shell: bash shell: bash
run: | run: |
git clone --branch v1.6.0 --depth 1 https://github.com/jasongin/nvs.git ~/.nvs . ./test/release/install.sh
while ! timeout 60 bash -c '. ~/.nvs/nvs.sh add $NODE && nvs use $NODE'; do
cd ~/.nvs
while !(git clean -xdf); do echo "'git clean' failed - retrying..."; done
cd -
done
. ~/.nvs/nvs.sh --version
nvs use $NODE
node --version
npm config set audit false
npm config set optional false
npm config set save false
npm config set strict-ssl false
npm config set update-notifier false
npm --version
while !(npm install); do echo "'npm install' failed - retrying..."; done
if [[ $CAUSE == "schedule" ]]; then if [[ $CAUSE == "schedule" ]]; then
node test/ufuzz/job $BASE_URL $TOKEN $RUN_NUM node test/ufuzz/job $BASE_URL $TOKEN $RUN_NUM
else else

33
test/release/install.sh Executable file
View File

@@ -0,0 +1,33 @@
if command -v timeout &> /dev/null; then NATIVE=1; fi
timeout() {
T=$1
shift
shift
shift
expect <<EOF
set timeout $T
spawn -noecho sh -c "$@"
expect timeout { exit 124 } eof
catch wait ret
exit [lindex \$ret 3]
EOF
return $?
}
if [ $NATIVE ]; then unset -f timeout; fi
git clone --branch v1.6.0 --depth 1 https://github.com/jasongin/nvs.git ~/.nvs
while ! timeout 60 bash -c ". ~/.nvs/nvs.sh add $NODE && nvs use $NODE"; do
cd ~/.nvs
while !(git clean -xdf); do echo "'git clean' failed - retrying..."; done
cd -
done
. ~/.nvs/nvs.sh --version
nvs use $NODE
node --version
npm config set audit false
npm config set optional false
npm config set save false
npm config set strict-ssl false
npm config set update-notifier false
npm --version
while !(npm install); do echo "'npm install' failed - retrying..."; done