Skip to content

CI: add script for installing NodeJS and update it to v20 #123981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/ci/docker/host-x86_64/mingw-check/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
mingw-w64 \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sL https://nodejs.org/dist/v16.9.0/node-v16.9.0-linux-x64.tar.xz | tar -xJ
ENV PATH="/node-v16.9.0-linux-x64/bin:${PATH}"
ENV RUST_CONFIGURE_ARGS="--set rust.validate-mir-opts=3"

COPY scripts/nodejs.sh /scripts/
RUN sh /scripts/nodejs.sh /node
ENV PATH="/node/bin:${PATH}"

# Install es-check
# Pin its version to prevent unrelated CI failures due to future es-check versions.
RUN npm install [email protected] [email protected] -g
Expand Down
6 changes: 3 additions & 3 deletions src/ci/docker/host-x86_64/test-various/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
qemu-system-x86 \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sL https://nodejs.org/dist/v18.12.0/node-v18.12.0-linux-x64.tar.xz | \
tar -xJ
COPY scripts/nodejs.sh /scripts/
RUN sh /scripts/nodejs.sh /node
ENV PATH="/node/bin:${PATH}"

WORKDIR /build/
COPY scripts/musl-toolchain.sh /build/
Expand All @@ -45,7 +46,6 @@ ENV WASI_SDK_PATH=/wasi-sdk-22.0

ENV RUST_CONFIGURE_ARGS \
--musl-root-x86_64=/usr/local/x86_64-linux-musl \
--set build.nodejs=/node-v18.12.0-linux-x64/bin/node \
--set rust.lld

# Some run-make tests have assertions about code size, and enabling debug
Expand Down
6 changes: 3 additions & 3 deletions src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ ENV GCC_EXEC_PREFIX="/usr/lib/gcc/"

COPY host-x86_64/x86_64-gnu-tools/checktools.sh /tmp/

RUN curl -sL https://nodejs.org/dist/v14.20.0/node-v14.20.0-linux-x64.tar.xz | tar -xJ
ENV NODE_FOLDER=/node-v14.20.0-linux-x64/bin
ENV PATH="$NODE_FOLDER:${PATH}"
COPY scripts/nodejs.sh /scripts/
RUN sh /scripts/nodejs.sh /node
ENV PATH="/node/bin:${PATH}"

COPY host-x86_64/x86_64-gnu-tools/browser-ui-test.version /tmp/

Expand Down
10 changes: 10 additions & 0 deletions src/ci/docker/scripts/nodejs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -ex

NODEJS_VERSION=v20.12.2
INSTALL_PATH=${1:-/node}

url="https://nodejs.org/dist/${NODEJS_VERSION}/node-${NODEJS_VERSION}-linux-x64.tar.xz"
curl -sL "$url" | tar -xJ
mv node-${NODEJS_VERSION}-linux-x64 "${INSTALL_PATH}"
Loading