diff --git a/.github/workflows/tools-rippled.yml b/.github/workflows/tools-rippled.yml index 193659a..d662ac5 100644 --- a/.github/workflows/tools-rippled.yml +++ b/.github/workflows/tools-rippled.yml @@ -23,6 +23,10 @@ env: DOXYGEN_VERSION: 1.9.8+ds-2build5 GCC_VERSION: 14 GRAPHVIZ_VERSION: 2.42.2-9ubuntu0.1 + NODE_VERSION: 24.5.0 + NPM_VERSION: 11.5.2 + NVM_VERSION: 0.40.3 + PRETTIER_VERSION: 3.6.2 PRE_COMMIT_VERSION: 4.2.0 UBUNTU_VERSION: noble @@ -38,6 +42,7 @@ jobs: tool: - clang-format - documentation + - prettier runs-on: ${{ matrix.architecture.runner }} permissions: packages: write @@ -91,6 +96,10 @@ jobs: DOXYGEN_VERSION=${{ env.DOXYGEN_VERSION }} GCC_VERSION=${{ env.GCC_VERSION }} GRAPHVIZ_VERSION=${{ env.GRAPHVIZ_VERSION }} + NODE_VERSION=${{ env.NODE_VERSION }} + NPM_VERSION=${{ env.NPM_VERSION }} + NVM_VERSION=${{ env.NVM_VERSION }} + PRETTIER_VERSION=${{ env.PRETTIER_VERSION }} PRE_COMMIT_VERSION=${{ env.PRE_COMMIT_VERSION }} context: docker/tools-rippled outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true @@ -122,6 +131,7 @@ jobs: tool: - clang-format - documentation + - prettier runs-on: ubuntu-24.04 needs: - build diff --git a/docker/tools-rippled/Dockerfile b/docker/tools-rippled/Dockerfile index 768930b..0da512c 100644 --- a/docker/tools-rippled/Dockerfile +++ b/docker/tools-rippled/Dockerfile @@ -51,8 +51,7 @@ ENV PATH=${VIRTUAL_ENV}/bin:${PATH} FROM base AS clang-format -# These are not inherited from base image. -ARG UBUNTU_VERSION +# This is not inherited from base image. ARG DEBIAN_FRONTEND=noninteractive # Install clang-format. @@ -69,8 +68,7 @@ WORKDIR ${HOME} FROM base AS documentation -# These are not inherited from base image. -ARG UBUNTU_VERSION +# This is not inherited from base image. ARG DEBIAN_FRONTEND=noninteractive # Install cmake, required to build the `docs` target. @@ -119,3 +117,30 @@ EOF ENV HOME=/root WORKDIR ${HOME} + +# ====================== PRETTIER IMAGE ====================== +# Note, we do not install a compiler here. + +FROM base AS prettier + +# This is not inherited from base image. +ARG DEBIAN_FRONTEND=noninteractive + +# Install node and npm via nvm, and then install prettier, see also +# https://nodejs.org/en/download. +ARG NODE_VERSION +ARG NPM_VERSION +ARG NVM_VERSION +ARG PRETTIER_VERSION +ENV NPM_CONFIG_REGISTRY=https://registry.npmjs.org +RUN <