Skip to content

Commit a2b2bb0

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 6fbaf53 commit a2b2bb0

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
@@ -97,6 +97,13 @@ jobs:
9797
with:
9898
key: ${{ matrix.target }}
9999

100+
- name: Add matrix env variables to the environment
101+
if: matrix.env
102+
run: |
103+
echo '${{ toJson(matrix.env) }}' |
104+
jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV
105+
shell: bash
106+
100107
- name: Run natively
101108
if: "!matrix.docker"
102109
run: ./ci/run.sh ${{ matrix.target }}
@@ -163,6 +170,13 @@ jobs:
163170
with:
164171
key: ${{ matrix.target }}
165172

173+
- name: Add matrix env variables to the environment
174+
if: matrix.env
175+
run: |
176+
echo '${{ toJson(matrix.env) }}' |
177+
jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV
178+
shell: bash
179+
166180
- name: Execute run-docker.sh
167181
run: ./ci/run-docker.sh ${{ matrix.target }}
168182

0 commit comments

Comments
 (0)