diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb6996daa0..51f87091f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,13 +16,14 @@ # * 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: @@ -30,17 +31,19 @@ jobs: 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 }} @@ -48,11 +51,18 @@ jobs: - 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 @@ -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 && @@ -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 }} @@ -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 @@ -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 }}