Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,53 @@
# * https://github.com/actions/upload-artifact
# * https://github.com/marketplace/actions/cancel-workflow-action
# * https://github.com/vmactions/freebsd-vm
# * https://github.com/marketplace/actions/docker-setup-qemu

on: [push, pull_request]
name: build
jobs:
# Linux + macOS + Windows Python 3
py3:
name: py3-${{ matrix.os }}-${{ startsWith(matrix.os, 'windows') && matrix.archs || 'all' }}
name: py3-${{ matrix.os }}-${{ matrix.archs }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
archs: "x86_64 i686"
archs: "x86_64 i686 aarch64 ppc64le s390x"
- os: macos-12
archs: "x86_64 arm64"
archs: "x86_64 arm64 universal2"
- os: windows-2019
archs: "AMD64"
- os: windows-2019
archs: "ARM64"
- os: windows-2019
archs: "x86"

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Set up QEMU
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Create wheels + run tests
uses: pypa/cibuildwheel@v2.11.2
uses: pypa/cibuildwheel@v2.12.1
env:
CIBW_ARCHS: "${{ matrix.archs }}"
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x}"

- name: Upload wheels
uses: actions/upload-artifact@v3
Expand All @@ -76,6 +86,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12]
include:
- os: windows-2019
archs: "x86"
- os: windows-2019
archs: "x64"
env:
CIBW_TEST_COMMAND:
PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/runner.py &&
Expand All @@ -85,7 +100,7 @@ jobs:

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

Expand All @@ -94,6 +109,19 @@ jobs:
with:
python-version: 3.9

- name: Prepare compiler environment for Windows
if: matrix.os == 'windows-2019'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.archs }}

- name: Set Windows environment variables
if: matrix.os == 'windows-2019'
shell: bash
run: |
echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV
echo "MSSdk=1" >> $GITHUB_ENV

- name: Create wheels + run tests
uses: pypa/cibuildwheel@v1.12.0

Expand All @@ -115,7 +143,7 @@ jobs:
runs-on: macos-12
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

Expand Down