generator icon indicating copy to clipboard operation
generator copied to clipboard

ci(workflow): workflow execution optimizations

Open SHUBHANSHU602 opened this issue 5 months ago • 5 comments

Description

While reviewing pr-testing-with-test-project.yml, I noticed a couple of opportunities to further optimize the workflow execution. I'd like to discuss whether these improvements would be appropriate before opening individual PRs.

1. Add workflow concurrency

Currently, multiple workflow runs can execute simultaneously when several commits are pushed to the same PR in quick succession, even though only the latest run is relevant.

Proposed change:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
  cancel-in-progress: true

Benefits:

  • Cancel outdated workflow runs automatically.
  • Reduce unnecessary CI resource usage.
  • Provide faster feedback for the latest commit.

2. Cache npm dependencies

The workflow installs dependencies using npm ci on every run. Enabling the built-in npm cache in actions/setup-node could reduce setup time.

Proposed change:

- uses: actions/setup-node@v4
  with:
    node-version: "${{ steps.lockversion.outputs.version }}"
    cache: npm

(If needed, cache-dependency-path can be configured based on the repository's lockfile location.)

Benefits:

  • Faster dependency installation.
  • Reduced workflow execution time.
  • Lower network usage during CI.

SHUBHANSHU602 avatar Jun 25 '26 04:06 SHUBHANSHU602

@derberg please a look at it.

SHUBHANSHU602 avatar Jun 25 '26 05:06 SHUBHANSHU602

@SHUBHANSHU602 the issue is valid you can work on it!

Adi-204 avatar Jul 02 '26 13:07 Adi-204

@SHUBHANSHU602 can i work on this issue, it would be great to do CI integration work

NiravDongre avatar Jul 12 '26 03:07 NiravDongre

@NiravDongre I have already done most of work just doing some research on npm caching part . So if u wish to contribute please find another issue. There are many approved issue u can try them.

SHUBHANSHU602 avatar Jul 12 '26 17:07 SHUBHANSHU602

@SHUBHANSHU602 ok, hope you can complete your research

NiravDongre avatar Jul 13 '26 02:07 NiravDongre