-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
build: improve artifacts IO #15165
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
build: improve artifacts IO #15165
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53406/ |
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| name: babel-artifact | ||
| - name: Generate runtime helpers |
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.
This step is removed because the runtime helpers are stored in the artifacts, too.
| !**/node_modules/** | ||
| name: babel8-artifact | ||
| path: babel-artifact.tar | ||
| retention-days: 5 |
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 default retention days is 90, much longer than we need because the artifact is not for download purpose. Here we decrease the time so we can free up some CI storage for other projects.
| BABEL_TYPES_8_BREAKING: true | ||
| - name: Prepare artifacts | ||
| run: | | ||
| ./scripts/get-artifact-files.sh | tar --null -cvf babel-artifact.tar --files-from=- |
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.
We don't need to compress the archive because @actions/upload will compress it during transfer. Also I use -v here so we can check what is included in the artifacts.
nicolo-ribaudo
left a comment
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.
I'm very surprised that the action doesn't do this by itself.
liuxingbaoyu
left a comment
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.
I'm surprised there is no automatic compression.
The artifact download is slow because each file is uploaded separately to an HTTP endpoint. Currently there are 2355 files in the artifacts.
In this PR we archive the artifacts before uploading, then we extract the archive after downloading. This approach is also recommended by the
@actions/uploadmaintainers.After this PR, it takes less than 3 seconds to download and extract artifacts.