File tree Expand file tree Collapse file tree 2 files changed +6
-45
lines changed Expand file tree Collapse file tree 2 files changed +6
-45
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,11 @@ runs:
22
22
uses : ./
23
23
with :
24
24
script : |
25
- ${{ matrix.data. script }}
25
+ ${{ matrix.script }}
26
26
- name : Assert output
27
+ if : ${{ !!matrix.expected }}
27
28
run : |
28
- expected="${{ matrix.data. expected }}"
29
+ expected="${{ matrix.expected }}"
29
30
output="${{steps.run.outputs.result}}"
30
31
[[ "$output" != "$expected" ]] && echo "::error::❌ Expected '$expected', got '$output'" && exit 1
31
32
echo "✅ Test passed, outputs.result: ${{toJSON(steps.run.outputs.result)}}"
Original file line number Diff line number Diff line change @@ -71,51 +71,11 @@ jobs:
71
71
outputs :
72
72
matrix : ${{ steps.set-matrix.outputs.matrix }}
73
73
steps :
74
- - name : Checkout code
75
- uses : actions/checkout@v3
74
+ - uses : actions/checkout@v3
75
+ - uses : pkgxdev/dev@v0
76
76
- id : set-matrix
77
77
name : Discover E2E tests
78
- run : |
79
- log_content() {
80
- local content="$1"
81
- local label="${2:-}"
82
-
83
- if [[ -n "$label" ]]; then
84
- # Replace the beginning of each line with two spaces
85
- local indented_content="${content//$'\n'/$'\n' }"
86
- printf "%s:\n %s\n" "$label" "$indented_content"
87
- else
88
- echo "$content"
89
- fi
90
- }
91
-
92
- log_output() {
93
- echo ::group::Set outputs
94
- log_content "$(cat "$GITHUB_OUTPUT")" "GITHUB_OUTPUT"
95
- log_content "$(cat "$GITHUB_ENV")" "GITHUB_ENV"
96
- echo ::endgroup::
97
- }
98
-
99
- set_output() {
100
- local value="$1"
101
- local output_key="$2"
102
- local env_key="${3:-}"
103
-
104
- if [ -z "$value" ] || [ -z "$output_key" ]; then
105
- echo "Missing essential arguments to set_output_and_env"
106
- return 1
107
- fi
108
-
109
- # If env_key is empty, convert output_key to upper snake case
110
- if [ -z "$env_key" ]; then
111
- env_key=$(echo "$output_key" | awk '{print toupper($0)}' | sed 's/-/_/g')
112
- fi
113
-
114
- echo "$output_key=$value" >> "$GITHUB_OUTPUT"
115
- echo "$env_key=$value" >> "$GITHUB_ENV"
116
- }
117
- set_output "{\"include\":$(jq -c '[.[]]' test/e2e_tests.json)}" "matrix"
118
- log_output
78
+ run : mix e2e.set_github_matrix matrix
119
79
120
80
e2e-tests :
121
81
needs : [ build, e2e-tests-discovery ]
You can’t perform that action at this time.
0 commit comments