Install Node.js 16 and 18 by default (and 20 additionally) (#98)

* Install Node.js 16 and 18 by default (and 20 additionally)

* Use caching for go test
This commit is contained in:
Rene Leonhardt
2023-07-27 14:31:50 +02:00
committed by GitHub
parent 311d8fff18
commit 284416fdf8
6 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ for ver in "${NODE[@]}"; do
wget "https://nodejs.org/download/release/latest-v${ver}.x/node-$VER-linux-$(node_arch).tar.xz" -O "node-$VER-linux-$(node_arch).tar.xz"
tar -Jxf "node-$VER-linux-$(node_arch).tar.xz" --strip-components=1 -C "$NODEPATH"
rm "node-$VER-linux-$(node_arch).tar.xz"
if [[ "${ver}" == "16" ]]; then
if [[ "${ver}" == "18" ]]; then # make this version the default (latest LTS)
sed "s|^PATH=|PATH=$NODEPATH/bin:|mg" -i /etc/environment
fi
export PATH="$NODEPATH/bin:$PATH"
@@ -25,7 +25,7 @@ function replaceEtcEnvironmentVariable {
variable_name="$1"
variable_value="$2"
# modify /etc/environemnt in place by replacing a string that begins with variable_name
# modify /etc/environment in place by replacing a string that begins with variable_name
# removed quotes for the docker env metadata reader
sudo sed -i -e "s%^${variable_name}=.*$%${variable_name}=${variable_value}%" /etc/environment
}
@@ -74,10 +74,10 @@ function appendEtcEnvironmentPath {
# /etc/environment
#
# TODO: there might be the others variables to be processed in the same way as "PATH" variable
# ie MANPATH, INFOPATH, LD_*, etc. In the current implementation the values from /etc/evironments
# ie MANPATH, INFOPATH, LD_*, etc. In the current implementation the values from /etc/environment
# replace the values of the current environment
function reloadEtcEnvironment {
# add `export ` to every variable of /etc/environemnt except PATH and eval the result shell script
# add `export ` to every variable of /etc/environment except PATH and eval the result shell script
eval "$(grep -v '^PATH=' /etc/environment | sed -e 's%^%export %')"
# handle PATH specially
etc_path=$(getEtcEnvironmentVariable PATH)
+2 -2
View File
@@ -20,8 +20,8 @@ echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee
printf "\n\t🐋 Installed NVM 🐋\t\n"
nvm --version
# node 12 and 16 are installed already in act-*
versions=("14")
# node 16 and 18 are already installed in act-*
versions=("20")
JSON=$(wget -qO- https://nodejs.org/download/release/index.json | jq --compact-output)
for V in "${versions[@]}"; do