Skip to content

Commit b84a712

Browse files
committed
ci: Add matrix env variables to the environment
Variables set with `env` in the matrix never propagated into the environment. Add a step in test_tier1 and test_tier2 that reads the env context from the matrix and adds the variables to the environment used by later steps.
1 parent a5fc46f commit b84a712

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ jobs:
107107
with:
108108
key: ${{ matrix.target }}
109109

110+
- name: Add matrix env variables to the environment
111+
if: matrix.env
112+
run: |
113+
echo '${{ toJson(matrix.env) }}' |
114+
jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV
115+
shell: bash
116+
110117
- name: Run natively
111118
if: "!matrix.docker"
112119
run: ./ci/run.sh ${{ matrix.target }}
@@ -173,6 +180,13 @@ jobs:
173180
with:
174181
key: ${{ matrix.target }}
175182

183+
- name: Add matrix env variables to the environment
184+
if: matrix.env
185+
run: |
186+
echo '${{ toJson(matrix.env) }}' |
187+
jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV
188+
shell: bash
189+
176190
- name: Execute run-docker.sh
177191
run: ./ci/run-docker.sh ${{ matrix.target }}
178192

0 commit comments

Comments
 (0)