summaryrefslogtreecommitdiff
path: root/.github/workflows/build_wheel.yml
blob: 1a8b486843254dbf3e1296c55a200796279334f4 (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
name: Linux, macOS, Windows

on: [push, pull_request]

jobs:
  wheel:
    name: ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    timeout-minutes: 30
    strategy:
      fail-fast: false  # whether to exit the whole run on first failure
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        include:
          - {name: Linux, python: '3.9', os: ubuntu-latest}
    env:
      CIBW_TEST_COMMAND: python -u -Wa {project}/psutil/tests/runner.py
      CIBW_TEST_COMMAND_MACOS: LC_ALL='en_US.utf8' python -Wa {project}/psutil/tests/runner.py
      CIBW_TEST_EXTRAS: test
      # https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
      CIBW_SKIP: cp35-* pp*
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
      with:
        python-version: 3.9

    - name: (Windows) install Visual C++ for Python 2.7
      if: matrix.os == 'windows-latest'
      run: |
        choco install vcpython27 -f -y

    - name: Run tests
      run: |
        pip install cibuildwheel
        cibuildwheel .

    - name: Create wheels
      uses: actions/upload-artifact@v2
      with:
        name: wheels
        path: wheelhouse

    - name: Print hashes
      if: matrix.os == 'ubuntu-latest'
      run: |
        make generate-manifest
        python setup.py sdist
        mv dist/psutil*.tar.gz wheelhouse/
        python scripts/internal/print_hashes.py wheelhouse/