summaryrefslogtreecommitdiff
path: root/.github/workflows/cygwin.yml
blob: 1865825c47592355abc804b46034b1821011a2a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# To enable this workflow on a fork, comment out:
#
# if: github.repository == 'numpy/numpy'
name: Test on Cygwin
on:
  pull_request:
    branches:
      - main
      - maintenance/**

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

permissions:
  contents: read # to fetch code (actions/checkout)

jobs:
  cygwin_build_test:
    runs-on: windows-latest
    if: "github.repository == 'numpy/numpy'"
    steps:
      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
        with:
          submodules: recursive
          fetch-depth: 0
      - name: Install Cygwin
        uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # v4
        with:
          platform: x86_64
          install-dir: 'C:\tools\cygwin'
          packages: >-
            python39-devel python39-zipp python39-importlib-metadata
            python39-cython python39-pip python39-wheel python39-cffi
            python39-pytz python39-setuptools python39-pytest
            python39-hypothesis liblapack-devel
            gcc-fortran gcc-g++ git dash
      - name: Set Windows PATH
        uses: egor-tensin/cleanup-path@8469525c8ee3eddabbd3487658621a6235b3c581 # v3
        with:
          dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack'
      - name: Verify that bash is Cygwin bash
        run: |
          command bash
          bash -c "uname -svrmo"
      - name: Tell Cygwin's git about this repository.
        run: |
          dash -c "which git; /usr/bin/git config --system --add safe.directory /cygdrive/d/a/numpy/numpy"
      - name: Verify python version
        # Make sure it's the Cygwin one, not a Windows one
        run: |
          dash -c "which python3.9; /usr/bin/python3.9 --version -V"
      - name: Build NumPy wheel
        run: |
          dash -c "/usr/bin/python3.9 -m pip install 'setuptools<49.2.0' pytest pytz cffi pickle5 importlib_metadata typing_extensions"
          dash -c "/usr/bin/python3.9 -m pip install -r test_requirements.txt"
          dash -c "/usr/bin/python3.9 setup.py bdist_wheel"
      - name: Install new NumPy
        run: |
          bash -c "/usr/bin/python3.9 -m pip install dist/numpy-*cp39*.whl"
      - name: Rebase NumPy compiled extensions
        run: |
          dash "tools/rebase_installed_dlls_cygwin.sh" 3.9
      - name: Run NumPy test suite
        shell: "C:\\tools\\cygwin\\bin\\bash.exe -o igncr -eo pipefail {0}"
        run: |
          /usr/bin/python3.9 runtests.py -n
      - name: Upload wheel if tests fail
        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
        if: failure()
        with:
          name: numpy-cygwin-wheel
          path: dist/numpy-*cp39*.whl
      - name: Check the extension modules on failure
        if: failure()
        run: |
          dash -c "/usr/bin/python3.9 -m pip show numpy"
          dash -c "/usr/bin/python3.9 -m pip show -f numpy | grep .dll"
          dash -c "/bin/tr -d '\r' <tools/list_installed_dll_dependencies_cygwin.sh >list_dlls_unix.sh"
          dash "list_dlls_unix.sh" 3.9
      - name: Print installed package versions on failure
        if: failure()
        run: |
          cygcheck -c