# Executed on every push by GitHub Actions. This runs CI tests and # generates wheels (not all) on the following platforms: # # * Linux # * macOS # * Windows (disabled) # * FreeBSD # # To skip certain builds see: # https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip # # External GH actions: # * https://github.com/pypa/cibuildwheel # * https://github.com/actions/checkout # * https://github.com/actions/setup-python # * https://github.com/actions/upload-artifact # * https://github.com/marketplace/actions/cancel-workflow-action # * https://github.com/vmactions/freebsd-vm on: [push, pull_request] name: build jobs: # Linux + macOS + Python 3 linux-macos-py3: name: ${{ matrix.os }}-py3 runs-on: ${{ matrix.os }} timeout-minutes: 20 strategy: fail-fast: false matrix: # os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-10.15] include: - {name: Linux, python: '3.9', os: ubuntu-latest} env: CIBW_TEST_COMMAND: PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/runner.py && PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/test_memleaks.py CIBW_TEST_EXTRAS: test CIBW_BUILD: 'cp36-* cp37-* cp38-* cp39-* cp310-*' CIBW_SKIP: '*-musllinux_*' steps: - name: Cancel previous runs uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: 3.9 - name: Install cibuildwheel run: pip install cibuildwheel # - name: (Windows) install Visual C++ for Python 2.7 # if: matrix.os == 'windows-latest' # run: | # choco install vcpython27 -f -y - name: Run tests run: 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/ # Linux + macOS + Python 2 linux-macos-py2: name: ${{ matrix.os }}-py2 runs-on: ubuntu-latest timeout-minutes: 20 strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] include: - {name: Linux, python: '3.9', os: ubuntu-latest} env: CIBW_ARCHS: 'x86_64 i686' CIBW_TEST_COMMAND: PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/runner.py && PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/test_memleaks.py CIBW_TEST_EXTRAS: test CIBW_BUILD: 'cp27-*' CIBW_SKIP: '*-musllinux_*' steps: - name: Cancel previous runs uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: 3.9 - name: Install cibuildwheel run: pip install cibuildwheel==1.12.0 - name: Run tests run: 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/ freebsd: runs-on: macos-10.15 steps: - name: Cancel previous runs uses: styfle/cancel-workflow-action@0.6.0 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 - name: Run tests id: test uses: vmactions/freebsd-vm@v0.1.5 with: usesh: true prepare: pkg install -y gcc python3 run: | set +e export \ PYTHONUNBUFFERED=1 \ PYTHONWARNINGS=always \ PSUTIL_DEBUG=1 python3 -m pip install --user setuptools python3 setup.py install python3 psutil/tests/runner.py python3 psutil/tests/test_memleaks.py linters: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - name: 'Run linters' run: | # py2 curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py python2 get-pip.py python2 -m pip install flake8 python2 -m flake8 . # py3 python3 -m pip install flake8 isort python3 -m flake8 . python3 -m isort --settings=.isort.cfg . # clinter find . -type f \( -iname "*.c" -o -iname "*.h" \) | xargs python3 scripts/internal/clinter.py