Skip to content

Commit e2824a5

Browse files
authored
Add composite replacement to README.md (#647)
This adds example workflow YAML to provide an example of how to replace the composite action with OS-specific actions in a multi-OS job. Further mentions the Windows Bash action at the to of the `README.md`.
1 parent 6cc8c3c commit e2824a5

File tree

2 files changed

+38
-15
lines changed

2 files changed

+38
-15
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ jobs:
466466
id: test-results
467467
uses: ./composite
468468
with:
469-
check_name: Test Results (${{ matrix.os-label }} composite python ${{ matrix.python }})
469+
check_name: Test Results (${{ matrix.os-label }} composite)
470470
files: |
471471
artifacts/**/*.xml
472472
artifacts\**\*.xml

README.md

+37-14
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,31 @@ or ![ARM Linux](misc/badge-arm.svg) self-hosted runners that support Docker:
3636
3737
See the [notes on running this action with absolute paths](#running-with-absolute-paths) if you cannot use relative test result file paths.
3838
39-
Use this for ![macOS](misc/badge-macos.svg) (e.g. `runs-on: macos-latest`) runners:
39+
Use this for ![macOS](misc/badge-macos.svg) (e.g. `runs-on: macos-latest`) runners (no Docker needed):
4040
```yaml
4141
- name: Publish Test Results
4242
uses: EnricoMi/publish-unit-test-result-action/macos@v2
4343
if: always()
4444
with:
45-
files: |
46-
test-results/**/*.xml
47-
test-results/**/*.trx
48-
test-results/**/*.json
45+
files: …
4946
```
5047

51-
… and ![Windows](misc/badge-windows.svg) (e.g. `runs-on: windows-latest`) runners:
48+
… and ![Windows](misc/badge-windows.svg) (e.g. `runs-on: windows-latest`) runners (no Docker needed):
5249
```yaml
5350
- name: Publish Test Results
5451
uses: EnricoMi/publish-unit-test-result-action/windows@v2
5552
if: always()
5653
with:
57-
files: |
58-
test-results\**\*.xml
59-
test-results\**\*.trx
60-
test-results\**\*.json
54+
files: …
55+
```
56+
57+
For Windows **without PowerShell** installed, there is the Bash shell variant:
58+
```yaml
59+
- name: Publish Test Results
60+
uses: EnricoMi/publish-unit-test-result-action/windows/bash@v2
61+
if: always()
62+
with:
63+
files: …
6164
```
6265

6366
For **self-hosted** Linux GitHub Actions runners **without Docker** installed, please use:
@@ -66,10 +69,7 @@ For **self-hosted** Linux GitHub Actions runners **without Docker** installed, p
6669
uses: EnricoMi/publish-unit-test-result-action/linux@v2
6770
if: always()
6871
with:
69-
files: |
70-
test-results/**/*.xml
71-
test-results/**/*.trx
72-
test-results/**/*.json
72+
files: …
7373
```
7474

7575
See the [notes on running this action as a non-Docker action](#running-as-a-non-docker-action).
@@ -870,3 +870,26 @@ is **deprecated**, please use an action appropriate for your operating system an
870870
- Windows (Bash shell): `uses: EnricoMi/publish-unit-test-result-action/windows/bash@v2`
871871

872872
These are non-Docker variations of this action. For details, see section ["Running as a non-Docker action"](#running-as-a-non-docker-action) above.
873+
874+
The composite action was able to run on any operating system, as long as Bash shell is installed.
875+
The same behaviour can be achieved with multiple steps, each for a specific operating system:
876+
877+
```yaml
878+
- name: Publish Test Results
879+
uses: EnricoMi/publish-unit-test-result-action/linux@2
880+
if: runner.os == 'Linux'
881+
with:
882+
files: test-results/**/*.xml
883+
884+
- name: Publish Test Results
885+
uses: EnricoMi/publish-unit-test-result-action/macos@2
886+
if: runner.os == 'macOS'
887+
with:
888+
files: test-results/**/*.xml
889+
890+
- name: Publish Test Results
891+
uses: EnricoMi/publish-unit-test-result-action/windows/bash@2
892+
if: runner.os == 'Windows'
893+
with:
894+
files: test-results/**/*.xml
895+
```

0 commit comments

Comments
 (0)