Skip to content

Update test-loop.yml #3

Update test-loop.yml

Update test-loop.yml #3

Workflow file for this run

---
name: Test Loop
on:
push:
branches: [development]
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
colors: ${{ steps.colors.outputs.colores }}
steps:
- name: Define Colors
id: colors
run: |
echo 'colores=["red", "green", "blue"]' >> "$GITHUB_OUTPUT"
print-output:
runs-on: ubuntu-latest
needs: define-matrix
steps:
- name: Print variable
run: |
echo ${{ needs.define-matrix.outputs.colors }}
produce-artifacts:
runs-on: ubuntu-latest
needs: define-matrix
strategy:
matrix:
color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
steps:
- name: Define Color
env:
color: ${{ matrix.color }}
run: |
echo "$color" > color
- name: Produce Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.color }}
path: color
consume-artifacts:
runs-on: ubuntu-latest
needs:
- define-matrix
- produce-artifacts
strategy:
matrix:
color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
steps:
- name: Retrieve Artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.color }}
- name: Report Color
run: |
cat color