Skip to content

Commit b945154

Browse files
authored
Merge pull request #7286 from radarhere/numpy_cygwin
Include NumPy version in Cygwin pip cache key
2 parents f965b9a + 1f3ec1b commit b945154

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/test-cygwin.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,23 @@ jobs:
7676
with:
7777
dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack'
7878

79+
- name: Select Python version
80+
run: |
81+
ln -sf c:/cygwin/bin/python3.${{ matrix.python-minor-version }} c:/cygwin/bin/python3
82+
83+
- name: Get latest NumPy version
84+
id: latest-numpy
85+
shell: bash.exe -eo pipefail -o igncr "{0}"
86+
run: |
87+
python3 -m pip list --outdated | grep numpy | sed -r 's/ +/ /g' | cut -d ' ' -f 3 | sed 's/^/version=/' >> $GITHUB_OUTPUT
88+
7989
- name: pip cache
8090
uses: actions/cache@v3
8191
with:
8292
path: 'C:\cygwin\home\runneradmin\.cache\pip'
83-
key: ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }}
93+
key: ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-numpy${{ steps.latest-numpy.outputs.version }}-${{ hashFiles('.ci/install.sh') }}
8494
restore-keys: |
85-
${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-
86-
87-
- name: Select Python version
88-
run: |
89-
ln -sf c:/cygwin/bin/python3.${{ matrix.python-minor-version }} c:/cygwin/bin/python3
95+
${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-numpy${{ steps.latest-numpy.outputs.version }}-
9096
9197
- name: Build system information
9298
run: |
@@ -96,7 +102,7 @@ jobs:
96102
run: |
97103
bash.exe .ci/install.sh
98104
99-
- name: Install a different NumPy
105+
- name: Install latest NumPy
100106
shell: dash.exe -l "{0}"
101107
run: |
102108
python3 -m pip install -U numpy

0 commit comments

Comments
 (0)