From 7961bb33de0741121b1a89364c2daefb94b9a690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Wed, 24 Apr 2024 02:53:25 +0200 Subject: [PATCH 1/2] qa: replace `Dockerfile` `node` check with a dedicated job `package-lock-up-to-date` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That new job uses `package-lock-utd` package to verify `package-lock.json` is up2date with what `package.json` requires. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- .github/workflows/continuous-integration.yml | 11 +++++++++++ Dockerfile | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2763fdd4..d39ac3ce 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -154,3 +154,14 @@ jobs: run: "npm ci" - name: Run Jest run: "npm run test" + + package-lock-up-to-date: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - uses: "actions/setup-node@v4" + with: + check-latest: true + node-version: 21 + - name: "Check package-lock.json is up2date" + run: "npx --yes package-lock-utd" diff --git a/Dockerfile b/Dockerfile index ddd09acd..7e4b0dfb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,6 @@ COPY package*.json ./ COPY tsconfig.json ./ COPY webpack.config.ts ./ RUN npm ci -RUN apk add --no-cache jq && npx semver -r $(jq -r '.packages."".engines.node' package-lock.json) $(node -v) || (echo "ERROR: package-lock.json is not synchronized with Dockerfile node version." && exit 1) COPY ./src ./src RUN npm run build From ed19123222d909793e5a44e3fc9d6eca28842f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:41:45 +0200 Subject: [PATCH 2/2] qa: ensure that the container node version is allowed by the projects `package.json` engine version range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 7e4b0dfb..b8748c52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ COPY package*.json ./ COPY tsconfig.json ./ COPY webpack.config.ts ./ RUN npm ci +RUN apk add --no-cache jq && npx semver -r $(jq -r '.engines.node' package.json) $(node -v) || (echo "ERROR: Container node version is not allowed by projects package.json engine range." && exit 1) COPY ./src ./src RUN npm run build