Skip to content

Commit f742f91

Browse files
put matrix vars in env vars for whitespace safety
1 parent 603c47c commit f742f91

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/python-deps.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
python_deps_type: [pipenv, poetry, requirements, setup_py]
1616
python_version: [2, 3]
1717

18+
env:
19+
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
20+
PYTHON_VERSION: ${{ matrix.python_version }}
21+
1822
steps:
1923
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2024
- uses: actions/checkout@v2
@@ -32,7 +36,7 @@ jobs:
3236
set -x
3337
$GITHUB_WORKSPACE/python-setup/install_tools.sh
3438
35-
cd $GITHUB_WORKSPACE/python-setup/tests/${{ matrix.python_deps_type }}/requests-${{ matrix.python_version }}
39+
cd $GITHUB_WORKSPACE/python-setup/tests/${PYTHON_DEPS_TYPE}/requests-${PYTHON_VERSION}
3640
3741
case ${{ matrix.os }} in
3842
ubuntu-latest*) basePath="/opt";;
@@ -51,7 +55,7 @@ jobs:
5155
5256
- name: Verify packages installed
5357
run: |
54-
$GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh ${{ matrix.python_version }}
58+
$GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh ${PYTHON_VERSION}
5559
5660
# This one shouldn't fail, but also won't install packages
5761
test-setup-python-scripts-non-standard-location:
@@ -108,6 +112,10 @@ jobs:
108112
python_deps_type: [pipenv, poetry, requirements, setup_py]
109113
python_version: [2, 3]
110114

115+
env:
116+
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
117+
PYTHON_VERSION: ${{ matrix.python_version }}
118+
111119
steps:
112120
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
113121
- uses: actions/checkout@v2
@@ -124,7 +132,7 @@ jobs:
124132
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
125133
powershell -File $cmd
126134
127-
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/${{ matrix.python_deps_type }}/requests-${{ matrix.python_version }}
135+
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/${PYTHON_DEPS_TYPE}/requests-${PYTHON_VERSION}
128136
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
129137
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
130138
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
@@ -139,4 +147,4 @@ jobs:
139147
- name: Verify packages installed
140148
run: |
141149
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_123.ps1"
142-
powershell -File $cmd ${{ matrix.python_version }}
150+
powershell -File $cmd ${PYTHON_VERSION}

0 commit comments

Comments
 (0)