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.
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:
Benefits:
2. Cache npm dependencies
The workflow installs dependencies using
npm cion every run. Enabling the built-in npm cache inactions/setup-nodecould reduce setup time.Proposed change:
(If needed,
cache-dependency-pathcan be configured based on the repository's lockfile location.)Benefits: