This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* declaring a directory input parameter * fixing working directory of checking phase * updating README file
- Loading branch information
1 parent
c0e1b46
commit eab14a9
Showing
3 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# archiving-upload-artifact | ||
|
||
In our builds we noticed that [actions/upload-artifact](https://github.com/actions/upload-artifact) becomes really slow when trying to upload large numbers of files. | ||
In our builds we noticed that [actions/upload-artifact](https://github.com/marketplace/actions/upload-a-build-artifact) becomes really slow when trying to upload large numbers of files. | ||
|
||
For comaprison: | ||
|
||
|
@@ -10,3 +10,30 @@ For comaprison: | |
| Android Unit Test Results | 1192 | ~13MB | 2m 25s | | ||
|
||
This action attempts to reduce the upload time by putting all matched files into an archive before uploading. | ||
|
||
## Inputs | ||
The inputs of the action mirror [actions/upload-artifact](https://github.com/marketplace/actions/upload-a-build-artifact) except for path stripping: | ||
|
||
`upload-artifact` strips away the directory hierarchy that is common between all `path` inputs. (See [Upload using Multiple Paths and Exclusions]([actions/upload-artifact](https://github.com/marketplace/actions/upload-a-build-artifact))) | ||
|
||
To replicate the same behavior with this action, make sure to set the `directory` parameter. | ||
|
||
| Parameter | Description | | ||
|------------------|--------------| | ||
| `name` | The name under which the artifact will be uploaded | | ||
| `directory` | The base directory for all `path` values. Defaults to '`.`' | | ||
| `path` | 'A file, directory or wildcard pattern that describes what to upload. These must be relative to the `directory` input parameter.' | | ||
| `retention-days` | Duration after which artifact will expire in days. 0 means using default retention. Minimum 1 day. Maximum 90 days unless changed from the repository settings page. | | ||
|
||
## Example | ||
```yaml | ||
- name: Archive and upload Build Artifacts | ||
uses: RockLobster/[email protected] | ||
with: | ||
name: android-test-results | ||
directory: android/libs | ||
path: | | ||
*/build/test-results/** | ||
*/build/reports/** | ||
*/build/cucumber-reports/** | ||
``` |
This file contains 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 |
---|---|---|
|
@@ -10,17 +10,12 @@ inputs: | |
name: | ||
description: 'Artifact name' | ||
default: 'artifact' | ||
directory: | ||
description: 'The base directory ' | ||
default: '.' | ||
path: | ||
description: 'A file, directory or wildcard pattern that describes what to upload' | ||
description: 'A file, directory or wildcard pattern that describes what to upload. These must be relative to the `directory` input parameter.' | ||
required: true | ||
if-no-files-found: | ||
description: > | ||
The desired behavior if no files are found using the provided path. | ||
Available Options: | ||
warn: Output a warning but do not fail the action | ||
error: Fail the action with an error message | ||
ignore: Do not output any warnings or errors, the action does not fail | ||
default: 'warn' | ||
retention-days: | ||
description: > | ||
Duration after which artifact will expire in days. 0 means using default retention. | ||
|
@@ -44,11 +39,12 @@ runs: | |
uses: TheDoctor0/[email protected] | ||
with: | ||
filename: ${{ steps.generate-name.outputs.zip_name }} | ||
directory: ${{ inputs.directory }} | ||
path: ${{ inputs.path }} | ||
- name: Upload Archive | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.name }} | ||
retention-days: ${{ inputs.retention-days }} | ||
path: ${{ steps.generate-name.outputs.zip_name }} | ||
path: ${{ inputs.directory }}/${{ steps.generate-name.outputs.zip_name }} | ||
if-no-files-found: error |