Skip to content

Commit 6fef604

Browse files
authored
Update test-loop.yml
1 parent ded1b93 commit 6fef604

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

.github/workflows/test-loop.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,47 @@ jobs:
1111

1212
outputs:
1313
colors: ${{ steps.colors.outputs.colores }}
14+
project-json: ${{ steps.json-project-step.outputs.json-project }}
1415

1516
steps:
1617
- name: Define Colors
1718
id: colors
1819
run: |
1920
echo 'colores=["red", "green", "blue"]' >> "$GITHUB_OUTPUT"
2021
21-
## Print the output of the "define-matrix" job
22+
- name: Define JSON
23+
id: json-project-step
24+
run: |
25+
echo "json-project={\"count\":4,\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
26+
>> $GITHUB_OUTPUT
27+
28+
## Job 2: Print the output of the "define-matrix" job
2229
print-output:
2330
runs-on: ubuntu-latest
2431
needs: define-matrix
2532
steps:
26-
- name: Print variable
33+
- name: Print colors variable
2734
run: |
2835
echo ${{ needs.define-matrix.outputs.colors }}
2936
30-
# Job 2: Display data using "run" and "with"
31-
produce-artifacts:
32-
runs-on: ubuntu-latest
33-
needs: define-matrix
34-
strategy:
35-
matrix:
36-
color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
37-
38-
steps:
39-
- name: Define Color
40-
env:
41-
color: ${{ matrix.color }}
37+
- name: Print project-json variable
4238
run: |
43-
echo "$color" > color
39+
echo ${{ needs.define-matrix.outputs.project-json }}
40+
41+
# Job 3: Display data using "run" and "with"
42+
# produce-artifacts:
43+
# runs-on: ubuntu-latest
44+
# needs: define-matrix
45+
# strategy:
46+
# matrix:
47+
# color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
48+
49+
# steps:
50+
# - name: Define Color
51+
# env:
52+
# color: ${{ matrix.color }}
53+
# run: |
54+
# echo "$color" > color
4455

4556
# - name: Produce Artifact
4657
# uses: actions/upload-artifact@v4
@@ -55,7 +66,7 @@ jobs:
5566
# name: my-artifact
5667
# path: path/to/artifact/world.txt
5768

58-
# Job 3: Display data another way
69+
# Job 4: Display data another way
5970
# consume-artifacts:
6071
# runs-on: ubuntu-latest
6172
# needs:

0 commit comments

Comments
 (0)