From a7fb3c1bbd5d9ee125ba200611aa75556672199b Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 21 Feb 2022 15:41:52 +0200 Subject: [PATCH 1/2] Move into reusable workflow --- .github/workflows/wheels-build.yml | 75 ++++++++++++++++++ .github/workflows/wheels.yml | 121 ++--------------------------- 2 files changed, 83 insertions(+), 113 deletions(-) create mode 100644 .github/workflows/wheels-build.yml diff --git a/.github/workflows/wheels-build.yml b/.github/workflows/wheels-build.yml new file mode 100644 index 000000000..444ac9dc6 --- /dev/null +++ b/.github/workflows/wheels-build.yml @@ -0,0 +1,75 @@ +name: Build wheels + +on: + workflow_call: + inputs: + build-commit: + required: true + type: string + artifacts-name: + required: true + type: string + +env: + REPO_DIR: Pillow + BUILD_DEPENDS: "" + TEST_DEPENDS: "pytest pytest-cov pytest-timeout" + WHEEL_SDIR: wheelhouse + +jobs: + build: + name: ${{ matrix.os-name }} ${{ matrix.python }} ${{ matrix.platform }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ "macos-latest", "ubuntu-20.04" ] + python: [ "pypy3.7-7.3.8", "pypy3.8-7.3.8", "3.7", "3.8", "3.9", "3.10" ] + platform: [ "x86_64", "i686" ] + macos-target: [ "10.10" ] + exclude: + - os: "macos-latest" + platform: "i686" + include: + - os: "macos-latest" + os-name: "osx" + - os: "ubuntu-20.04" + os-name: "focal" + - os: "macos-11" + os-name: "osx" + platform: "arm64" + python: "3.10" + macos-target: "11.0" + - os: "macos-11" + os-name: "osx" + platform: "arm64" + python: "3.9" + macos-target: "11.0" + - os: "macos-11" + os-name: "osx" + platform: "arm64" + python: "3.8" + macos-target: "11.0" + env: + BUILD_COMMIT: ${{ inputs.build-commit }} + PLAT: ${{ matrix.platform }} + MB_PYTHON_VERSION: ${{ matrix.python }} + TRAVIS_OS_NAME: ${{ matrix.os-name }} + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos-target }} + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Build Wheel + run: .github/workflows/build.sh + - uses: actions/upload-artifact@v2 + with: + name: ${{ inputs.artifacts-name }} + path: wheelhouse/*.whl + # Uncomment to get SSH access for testing + # - name: Setup tmate session + # if: failure() + # uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 839f4fe67..848422216 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,125 +1,20 @@ - name: Wheels on: [push, pull_request, workflow_dispatch] -env: - REPO_DIR: Pillow - BUILD_DEPENDS: "" - TEST_DEPENDS: "pytest pytest-cov pytest-timeout" - WHEEL_SDIR: wheelhouse - jobs: build: - name: ${{ matrix.python }} ${{ matrix.os-name }} ${{ matrix.platform }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ "ubuntu-20.04", "macos-latest" ] - python: [ "pypy3.7-7.3.8", "pypy3.8-7.3.8", "3.7", "3.8", "3.9", "3.10" ] - platform: [ "x86_64", "i686" ] - macos-target: [ "10.10" ] - exclude: - - os: "macos-latest" - platform: "i686" - include: - - os: "macos-latest" - os-name: "osx" - - os: "ubuntu-20.04" - os-name: "focal" - - os: "macos-11" - os-name: "osx" - platform: "arm64" - python: "3.10" - macos-target: "11.0" - - os: "macos-11" - os-name: "osx" - platform: "arm64" - python: "3.9" - macos-target: "11.0" - - os: "macos-11" - os-name: "osx" - platform: "arm64" - python: "3.8" - macos-target: "11.0" - env: - BUILD_COMMIT: HEAD - PLAT: ${{ matrix.platform }} - MB_PYTHON_VERSION: ${{ matrix.python }} - TRAVIS_OS_NAME: ${{ matrix.os-name }} - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos-target }} - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Build Wheel - run: .github/workflows/build.sh - - uses: actions/upload-artifact@v2 - with: - name: wheels - path: wheelhouse/*.whl - # Uncomment to get SSH access for testing - # - name: Setup tmate session - # if: failure() - # uses: mxschmitt/action-tmate@v3 + uses: ./.github/workflows/wheels-build.yml + with: + build-commit: "HEAD" + artifacts-name: "wheels" build-latest: - name: ${{ matrix.python }} ${{ matrix.os-name }} ${{ matrix.platform }} latest - runs-on: ${{ matrix.os }} if: "!startsWith(github.ref, 'refs/tags/')" - strategy: - fail-fast: false - matrix: - os: [ "ubuntu-20.04", "macos-latest" ] - python: [ "pypy3.7-7.3.8", "pypy3.8-7.3.8", "3.7", "3.8", "3.9", "3.10" ] - platform: [ "x86_64", "i686" ] - macos-target: [ "10.10" ] - exclude: - - os: "macos-latest" - platform: "i686" - include: - - os: "macos-latest" - os-name: "osx" - - os: "ubuntu-20.04" - os-name: "focal" - - os: "macos-11" - os-name: "osx" - platform: "arm64" - python: "3.10" - macos-target: "11.0" - - os: "macos-11" - os-name: "osx" - platform: "arm64" - python: "3.9" - macos-target: "11.0" - - os: "macos-11" - os-name: "osx" - platform: "arm64" - python: "3.8" - macos-target: "11.0" - env: - BUILD_COMMIT: main - PLAT: ${{ matrix.platform }} - MB_PYTHON_VERSION: ${{ matrix.python }} - TRAVIS_OS_NAME: ${{ matrix.os-name }} - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos-target }} - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Build Wheel - run: .github/workflows/build.sh - - uses: actions/upload-artifact@v2 - with: - name: wheels-latest - path: wheelhouse/*.whl + uses: ./.github/workflows/wheels-build.yml + with: + build-commit: "main" + artifacts-name: "wheels-latest" release: name: Create Release From 3e75a17994ec930cb1110449f018edf36598f40e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 20 Feb 2022 20:21:21 +0200 Subject: [PATCH 2/2] Ignore PyCharm metadata --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3c5d4d3b9..accfdd59c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.pyc *.swp *~ +.idea build -working downloads +working