Skip to content

Commit

Permalink
add version matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Jun 28, 2024
1 parent 37b6f49 commit 84436b7
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,58 @@ on:
push:
branches:
- master

jobs:
job1:
runs-on: ubuntu-latest
outputs:
elixir: ${{ steps.set-matrix.outputs.elixir }}
steps:
- id: set-matrix
# run: echo "elixir={\"include\":[{\"elixir\":\"1.10.4\",\"otp\":\"23.0\"}]}" >> $GITHUB_OUTPUT
run: |
elixir_matrix=$(cat <<EOF
{
"include": [
{"elixir":"1.10.4","otp":"23.0"},
{"elixir":"1.17.0", "otp":"26.0"}
]
}
EOF
)
echo "elixir=${elixir_matrix}" >> $GITHUB_OUTPUT
job2:
needs: job1
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.job1.outputs.elixir) }}
name: Elixir ${{ matrix.elixir }} with OTP ${{ matrix.otp }}
steps:
- run: echo "Matrix - Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }}"

# VersionMatrix:
# runs-on: ubuntu-latest
# outputs:
# elixir: ${{ steps.set-matrix.outputs.elixir }}
# steps:
# - name: Set
# id: set-matrix
# run: echo 'elixir=[{"version":"1.10.4","otp":"23.0"},{"version":"1.11.2","otp":"23.0"}]' >> "$GITHUB_OUTPUT"

# TestingMatrix:
# runs-on: ubuntu-latest
# needs: VersionMatrix
# strategy:
# matrix: ${{ fromJson(needs.VersionMatrix.outputs.elixir) }}
# # name: Elixir ${{ matrix.version }} with OTP ${{ matrix.otp }}
# steps:
# - name: echo
# env:
# MATRIX: ${{ needs.VersionMatrix.outputs.elixir }}
# # run: echo "${{ matrix.otp }} ${{ matrix.version }}"
# run: echo $MATRIX

Test:
runs-on: ubuntu-latest
env:
Expand Down

0 comments on commit 84436b7

Please sign in to comment.