Open
Description
To Reproduce
When running the Storybook Test Runner with the --shard
option in GitHub Actions, issues occur due to the inclusion of slashes (e.g., 1/10
) in shard names. This is particularly problematic when renaming files or uploading artifacts.
Steps to reproduce:
- Execute the following GitHub Actions job:
jobs: storybook-test: strategy: matrix: shard: [1/10, 2/10] steps: - name: Run Storybook Tests run: npx storybook test --shard=${{ matrix.shard }} --coverage - name: Upload Coverage File run: mv coverage/storybook/coverage.json coverage/storybook/coverage-${{ matrix.shard }}.json
- The job fails with an error because file names containing slashes (e.g.,
coverage-1/10.json
) are invalid:mv: cannot move 'coverage/storybook/coverage.json' to 'coverage/storybook/coverage-1/10.json': No such file or directory
System
Its on Github Action CI
Additional Context
In GitHub Actions, file and artifact names containing slashes (/
) are invalid and result in errors. Currently, we use the following workaround:
- Escape shard names (e.g.,
1/10
) using a custom script:mv coverage/storybook/coverage.json coverage/storybook/coverage-1_10.json
- Use the escaped shard names (e.g.,
1_10
) as artifact names.
To improve usability, we propose the following enhancements:
- Add internal logic to escape slashes in shard names.
- Alternatively, provide an option to customize the shard name format.
These changes would eliminate the need for manual scripting and make the Test Runner more CI-friendly.