POC to use a file as source for the strategy:matrix
.
It works in 2 steps:
-
Loads a matrix from
matrix.json
and set it as one of its output. -
Runs after
setup
is done and usefromJson()
to parsesetup
'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
but it's also possible to do it in the action like so:
run: |
content=`cat ./matrix.json`
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
echo "::set-output name=matrix::$content"