chore: CI - build - reusable workflow artifacts - #28122
Conversation
b3ea236 to
a108172
Compare
|
@aqrln please approve workflows |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a dedicated build workflow that other CI workflows will depend on to reuse build artifacts as cache, aiming to optimize CI performance by avoiding redundant builds.
Key changes:
- Creates a new
Buildworkflow that runs on pull requests and builds across multiple Node.js versions - Updates
bundle-sizeworkflow to depend on theBuildworkflow completion viaworkflow_runtrigger - Adds turbo caching setup in the shared setup action to enable build artifact reuse
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/build.yml |
New workflow that builds the project across Node.js versions 18, 20, 22, and 24 |
.github/workflows/bundle-size.yml |
Updated to trigger after Build workflow completion and re-enabled TSC and build steps |
.github/actions/setup/action.yml |
Added turbo cache configuration and offline-preferred pnpm install |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| workflow_run: | ||
| workflows: [Build] | ||
| types: | ||
| - completed | ||
| paths-ignore: |
There was a problem hiding this comment.
The paths-ignore configuration at line 8 will not work with workflow_run triggers. The paths-ignore filter only applies to direct event triggers like pull_request or push, not to workflow_run events. Consider moving the path filtering logic to the Build workflow or using conditional job execution based on changed files.
| uses: actions/cache@v4 | ||
| with: | ||
| path: .turbo | ||
| key: ${{ runner.os }}-node-${{ inputs.node-version }}-turbo-${{ github.sha }} |
There was a problem hiding this comment.
Using github.sha in the cache key means each commit will create a new cache entry, preventing cache reuse across commits. Consider using a more stable key like ${{ hashFiles('**/pnpm-lock.yaml', 'turbo.json') }} to enable cache sharing between commits with the same dependencies and turbo configuration.
| key: ${{ runner.os }}-node-${{ inputs.node-version }}-turbo-${{ github.sha }} | |
| key: ${{ runner.os }}-node-${{ inputs.node-version }}-turbo-${{ hashFiles('**/pnpm-lock.yaml', 'turbo.json') }} |
This PR introduces build workflow that other workflows should depend to re-use build artifacts as cache to save time. Once this PR lands confirming that we can save time using build artifacts, I'll work on CI optimization utilizing turbo caching.