Skip to content

ci(workflow): workflow execution optimizations #2133

Description

@SHUBHANSHU602

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions