https://github.com/nobe4/test-action-matrix
https://github.com/nobe4/test-action-matrix
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nobe4/test-action-matrix
- Owner: nobe4
- Created: 2022-02-09T12:11:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-09T13:01:04.000Z (over 4 years ago)
- Last Synced: 2025-07-26T20:57:28.747Z (12 months ago)
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# test-action-matrix
POC to use different strategies for filling `strategy:matrix`.
## Notes about `json`.
It works in 2 steps:
1. [setup](https://github.com/nobe4/test-action-matrix/blob/master/.github/workflows/test.yml#L7-L17)
Loads a matrix from [`matrix.json`](matrix.json) and set it as one of its output.
2. [run](https://github.com/nobe4/test-action-matrix/blob/master/.github/workflows/test.yml#L19-L25)
Runs after `setup` is done and use `fromJson()` to parse `setup`'s output into a mapping, which then gets used for the runs.
**Result**:

**Note**: The JSON has to be minified before the `echo "::set-output name=matrix::..."`. Here I've minified [`matrix.json`](matrix.json) but it's also possible to do it in the action like so:
```yaml
run: |
content=`cat ./matrix.json`
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
echo "::set-output name=matrix::$content"
```