Skip to content

Commit e45d8e0

Browse files
snoggetgross35
authored andcommitted
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. (backport <rust-lang#4345>) (cherry picked from commit 84a04a1)
1 parent 232dabc commit e45d8e0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/ci.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ jobs:
108108
with:
109109
key: ${{ matrix.target }}
110110

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

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

0 commit comments

Comments
 (0)