|
25 | 25 | run: npm install
|
26 | 26 | shell: bash
|
27 | 27 | working-directory: ./core
|
28 |
| - - id: clean-component-name |
29 |
| - name: Clean Component Name |
30 |
| - # Remove `ion-` prefix from the `component` variable if it exists. |
31 |
| - run: | |
32 |
| - echo "component=$(echo ${{ inputs.component }} | sed 's/ion-//g')" >> $GITHUB_OUTPUT |
33 |
| - shell: bash |
34 |
| - - id: set-test-file |
35 |
| - name: Set Test File |
36 |
| - # Screenshots can be updated for all components or specified component(s). |
37 |
| - # If the `component` variable is set, then the test has the option to |
38 |
| - # - run all the file paths that are in a component folder. |
39 |
| - # -- For example: if the `component` value is "item", then the test will run all the file paths that are in the "src/components/item" folder. |
40 |
| - # -- For example: if the `component` value is "item chip", then the test will run all the file paths that are in the "src/components/item" and "src/components/chip" folders. |
41 |
| - run: | |
42 |
| - if [ -n "${{ steps.clean-component-name.outputs.component }}" ]; then |
43 |
| - echo "testFile=\$(echo '${{ steps.clean-component-name.outputs.component }}' | awk '{for(i=1;i<=NF;i++) \$i=\"src/components/\"\$i}1')" >> $GITHUB_OUTPUT |
44 |
| - else |
45 |
| - echo "testFile=$(echo '')" >> $GITHUB_OUTPUT |
46 |
| - fi |
47 |
| - shell: bash |
48 | 28 | - name: Test
|
49 | 29 | if: inputs.update != 'true'
|
50 |
| - run: npm run test.e2e.docker.ci ${{ steps.set-test-file.outputs.testFile }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} |
| 30 | + run: npm run test.e2e.docker.ci ${{ inputs.component }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} |
51 | 31 | shell: bash
|
52 | 32 | working-directory: ./core
|
53 | 33 | - name: Test and Update
|
|
69 | 49 | # which is why we not using the upload-archive
|
70 | 50 | # composite step here.
|
71 | 51 | run: |
|
72 |
| - npm run test.e2e.docker.ci ${{ steps.set-test-file.outputs.testFile }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots |
| 52 | + npm run test.e2e.docker.ci ${{ inputs.component }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots |
73 | 53 | git add src/\*.png --force
|
74 | 54 | mkdir updated-screenshots
|
75 | 55 | cd ../ && rsync -R --progress $(git diff --name-only --cached) core/updated-screenshots
|
|
0 commit comments