forked from sfreeman422/mocker
-
Notifications
You must be signed in to change notification settings - Fork 3
CI: run npm ci once via composite action + artifact sharing #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+55
−17
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
03c1d6e
Initial plan
Copilot 3c8adbd
Refactor CI to use composite action + artifacts to avoid repeated npm ci
Copilot 2396c37
Fix actions permissions for artifact upload/download in CI workflow
Copilot ea56ad0
Fix: restore execute permissions on node_modules/.bin after artifact …
Copilot 344ccd0
Fix: tar node_modules to preserve symlinks and permissions across art…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| name: 'Setup Node.js with cached dependencies' | ||
| description: 'Sets up Node.js and restores node_modules from the artifact uploaded by the setup job.' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: node-modules | ||
| path: . | ||
| - run: tar -xzf node-modules.tar.gz && rm node-modules.tar.gz | ||
| shell: bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow-level
permissionsblock sets onlycontents: read, which disables other defaultGITHUB_TOKENscopes.actions/upload-artifact/actions/download-artifactrequireactionspermissions, so the new artifact-based setup is likely to fail with permission errors. Consider addingactions: writefor thesetupjob (upload) andactions: readfor the dependent jobs (download), either at workflow level or overridden per job.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit
2396c37. Addedactions: writeto thesetupjob (needed forupload-artifact) andactions: readto each of the downstreamlint,format-check,build, andtestjobs (needed fordownload-artifact), while keeping the workflow-level default ofcontents: read.