Introduce retry mechanism for npm install in CI/CD

This commit addresses occasional pipeline failures caused by transient
network errors during dependency installation with `npm ci`. It
centralizes the logic for installing npm dependencies and introduces a
retry mechanism.

The new approach will attempt `npm ci` up to 5 times with a 5-second
interval between each attempt, thereby increasing the resilience of
CI/CD pipelines.

This commit adds a new script `npm-install.js` with `npm run
install-deps` command to centralize npm dependency installation process
throughout the project. Separate testing of scripts to a separate
workflow.

It removes unused `install` dependency from `package.json`.
This commit is contained in:
undergroundwires
2023-09-05 13:39:15 +02:00
parent 0a2a1a026b
commit 4beb1bb574
18 changed files with 313 additions and 190 deletions

View File

@@ -20,7 +20,7 @@ jobs:
uses: ./.github/actions/setup-node
-
name: Install dependencies
run: npm ci
uses: ./.github/actions/npm-install-dependencies
-
name: Run e2e tests
run: npm run test:cy:run