From 460a087296c961ffd7601d9d0c79fe1f7e956c14 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Wed, 11 Sep 2024 10:08:33 +0200 Subject: [PATCH] fix(cypress): read npm and node versions from package.json Signed-off-by: skjnldsv --- .github/workflows/cypress.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 7d7ac349ff..4a63f6e97f 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -42,12 +42,25 @@ jobs: - "9980:9980" steps: - - name: Use Node.js ${{ matrix.node-version }} + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: "^20" + fallbackNpm: "^9" + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: - node-version: ${{ matrix.node-version }} - - name: Set up npm7 - run: npm i -g npm@7 + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install node dependencies & build app + run: | + npm ci + TESTING=true npm run build --if-present - name: Checkout server uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7