| 1 |
name: Test on Cygwin |
| 2 |
on: |
| 3 |
pull_request: |
| 4 |
branches: |
| 5 |
- main |
| 6 |
- maintenance/** |
| 7 |
paths-ignore: |
| 8 |
- '**.pyi' |
| 9 |
- '**.md' |
| 10 |
- '**.rst' |
| 11 |
|
| 12 |
concurrency: |
| 13 |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 14 |
cancel-in-progress: true |
| 15 |
|
| 16 |
permissions: |
| 17 |
contents: read # to fetch code (actions/checkout) |
| 18 |
|
| 19 |
jobs: |
| 20 |
cygwin_build_test: |
| 21 |
runs-on: windows-latest |
| 22 |
# To enable this workflow on a fork, comment out: |
| 23 |
if: github.repository == 'numpy/numpy' |
| 24 |
steps: |
| 25 |
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| 26 |
with: |
| 27 |
submodules: recursive |
| 28 |
fetch-tags: true |
| 29 |
persist-credentials: false |
| 30 |
- name: Install Cygwin |
| 31 |
uses: egor-tensin/setup-cygwin@d2c752bab416d4b0662591bd366fc2686297c82d # v4 |
| 32 |
with: |
| 33 |
platform: x86_64 |
| 34 |
install-dir: 'C:\tools\cygwin' |
| 35 |
packages: >- |
| 36 |
python39=3.9.16-1 python39-devel=3.9.16-1 python39-pip python-pip-wheel |
| 37 |
python-setuptools-wheel liblapack-devel liblapack0 gcc-fortran |
| 38 |
gcc-g++ git dash cmake ninja |
| 39 |
- name: Set Windows PATH |
| 40 |
uses: egor-tensin/cleanup-path@f04bc953e6823bf491cc0bdcff959c630db1b458 # v4.0.1 |
| 41 |
with: |
| 42 |
dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' |
| 43 |
- name: Verify that bash is Cygwin bash |
| 44 |
run: | |
| 45 |
command bash |
| 46 |
bash -c "uname -svrmo" |
| 47 |
- name: Tell Cygwin's git about this repository. |
| 48 |
run: | |
| 49 |
dash -c "which git; /usr/bin/git config --system --add safe.directory /cygdrive/d/a/numpy/numpy" |
| 50 |
- name: Verify python version |
| 51 |
# Make sure it's the Cygwin one, not a Windows one |
| 52 |
run: | |
| 53 |
dash -c "which python3.9; /usr/bin/python3.9 --version -V" |
| 54 |
- name: Build NumPy wheel |
| 55 |
run: | |
| 56 |
dash -c "/usr/bin/python3.9 -m pip install build pytest hypothesis pytest-xdist Cython meson" |
| 57 |
dash -c "/usr/bin/python3.9 -m build . --wheel -Csetup-args=-Dblas=blas -Csetup-args=-Dlapack=lapack -Csetup-args=-Dcpu-dispatch=none -Csetup-args=-Dcpu-baseline=native" |
| 58 |
- name: Install NumPy from wheel |
| 59 |
run: | |
| 60 |
bash -c "/usr/bin/python3.9 -m pip install dist/numpy-*cp39*.whl" |
| 61 |
- name: Rebase NumPy compiled extensions |
| 62 |
run: | |
| 63 |
dash "tools/rebase_installed_dlls_cygwin.sh" 3.9 |
| 64 |
- name: Run NumPy test suite |
| 65 |
shell: "C:\\tools\\cygwin\\bin\\bash.exe -o igncr -eo pipefail {0}" |
| 66 |
run: | |
| 67 |
cd tools |
| 68 |
/usr/bin/python3.9 -m pytest --pyargs numpy -n2 -m "not slow" |
| 69 |
- name: Upload wheel if tests fail |
| 70 |
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 |
| 71 |
if: failure() |
| 72 |
with: |
| 73 |
name: numpy-cygwin-wheel |
| 74 |
path: dist/numpy-*cp39*.whl |
| 75 |
- name: Check the extension modules on failure |
| 76 |
if: failure() |
| 77 |
run: | |
| 78 |
dash -c "/usr/bin/python3.9 -m pip show numpy" |
| 79 |
dash -c "/usr/bin/python3.9 -m pip show -f numpy | grep .dll" |
| 80 |
dash -c "/bin/tr -d '\r' <tools/list_installed_dll_dependencies_cygwin.sh >list_dlls_unix.sh" |
| 81 |
dash "list_dlls_unix.sh" 3.9 |
| 82 |
- name: Print installed package versions on failure |
| 83 |
if: failure() |
| 84 |
run: | |
| 85 |
cygcheck -c |