From 97e8382a4179cbdde56f25b95de791a59e8cc4dd Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Tue, 24 Dec 2024 11:01:14 +0100 Subject: [PATCH 1/3] Use consistent node version --- .github/workflows/build.yml | 3 ++- .nvmrc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .nvmrc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5fdfc5a3..2bac314f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: + node-version-file: '.nvmrc' cache: 'npm' - run: npm ci - name: Cache PlatformIO @@ -74,7 +75,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version-file: '.nvmrc' cache: 'npm' - run: npm ci - run: npm test diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..d4b7699d3 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.18.1 From a2d84886c0569f52768f11cc09ca6cfeb32ef3cc Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Tue, 24 Dec 2024 13:55:10 +0100 Subject: [PATCH 2/3] Update .nvmrc --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index d4b7699d3..10fef252a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.18.1 +20.18 From 1a82a3bf7b5ed515c86838fa60a17dfcea033be5 Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Tue, 24 Dec 2024 20:30:54 +0000 Subject: [PATCH 3/3] Fix devcontainer --- .devcontainer/Dockerfile | 7 +------ .devcontainer/devcontainer.json | 7 ++----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d09c8a605..1340da91c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,12 +2,7 @@ # [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6 ARG VARIANT="3" -FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} - -# [Option] Install Node.js -ARG INSTALL_NODE="true" -ARG NODE_VERSION="lts/*" -RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi +FROM mcr.microsoft.com/devcontainers/python:0-${VARIANT} # [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. # COPY requirements.txt /tmp/pip-tmp/ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2a8e4712d..241acd79d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,10 +5,7 @@ "context": "..", "args": { // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9 - "VARIANT": "3", - // Options - "INSTALL_NODE": "true", - "NODE_VERSION": "lts/*" + "VARIANT": "3" } }, @@ -54,7 +51,7 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm install", + "postCreateCommand": "bash -i -c 'nvm install && npm ci'", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode"