Skip to content

Conversation

dhadka
Copy link
Contributor

@dhadka dhadka commented Oct 2, 2020

Adds input to limit the upload chunk size. This is useful for self-hosted runners with limited upload speeds, as an upload taking longer than the server timeout will fail. We used to have this configurable via an environment variable, but that was removed when splitting the cache action out into the cache module.

- name: Limit upload chunk size
  uses: actions/cache@v2
  with:
    path: **/node_modules
    key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
    upload-chunk-size: 4000000

Fixes #415

Copy link
Contributor

@joshmgross joshmgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to document this as an optional input in the action.yml file

action.yml Outdated
description: 'An ordered list of keys to use for restoring the cache if no cache hit occurred for key'
required: false
upload-chunk-size:
description: 'The chunk size used when uploading large cache files'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should include the unit in either the description or input name (upload-chunk-size-bytes)

Copy link
Contributor

@aiqiaoy aiqiaoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Any particular reason we are adding this option as input vs. environment variable?

@dhadka
Copy link
Contributor Author

dhadka commented Oct 2, 2020

@aiqiaoy No particular reason. If I had to give a reason, it would be for simplicity. This puts all arguments under with: instead of splitting some out under env:. In the end, inputs become environment variables anyway 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CACHE_UPLOAD_CHUNK_SIZE ignored?

4 participants