it-at-m / refarch-templates

All templates for the Reference Architecture of it@M
MIT License
8 stars 4 forks source link

[Maintenance] Parallelization of npm jobs #358

Open devtobi opened 2 months ago

devtobi commented 2 months ago

Relevant template

refarch-frontend, refarch-webcomponent

Problem description (optional)

Currently for our custom npm jobs defined in package.json we sequentially execute the steps (like prettier, ESLint, vue-tsc etc.). This also means that follow up jobs fail if the previous one failed. This hides important information about the result of a job (e.g. prettier fails and we don't know if ESLint would as well or not)

Desired solution

By using parallel execution of steps (e.g. with a package like https://github.com/open-cli-tools/concurrently) we can execute e.g. the linting steps in parallel and transparently show which part of the tooling failed. The tool waits until all defined jobs where run and then aggregates into a final status code. This way we give more transparency to the developer and increase the execution speed of linting (and potentially other stuff) on local machines and in CI/CD.

Considered alternatives (optional)

No response

Additional context (optional)

No response

No duplicate

Code of Conduct

devtobi commented 3 weeks ago

There was a discussion related to splitting the different linting tools into separate npm scripts so they can be executed in parallel but in separate steps inside GitHub Actions. We could combine both solutions and provide a parallelized script for local development running all lint-tools at once as well as providing individual scripts for GitHub Actions execution.

devtobi commented 2 weeks ago

Discussed as not planned, because speed is not a issue here.

devtobi commented 2 days ago

I tested this on a larger project and the speed improvements where significant. That's why should look further into this.