summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-11-25 14:43:55 +0900
committerGitHub <noreply@github.com>2021-11-25 14:43:55 +0900
commitbdf0511e29b02427437b03e7d8454bd5076e837f (patch)
tree2ec378629c48b23468dc4f5f7f6df46af9d712a0 /.github
parent6129789e9f6ebccdb19b23c2cd1dc9551e57fc53 (diff)
downloadmsgpack-python-bdf0511e29b02427437b03e7d8454bd5076e837f.tar.gz
Refactor CI (#492)
* Use cibuildwheel to build wheels. * Use matrix
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/black.yaml2
-rw-r--r--.github/workflows/linux.yml103
-rw-r--r--.github/workflows/mac.yml80
-rw-r--r--.github/workflows/test.yml45
-rw-r--r--.github/workflows/wheel.yml51
-rw-r--r--.github/workflows/windows.yaml99
6 files changed, 97 insertions, 283 deletions
diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml
index c545953..2961ed3 100644
--- a/.github/workflows/black.yaml
+++ b/.github/workflows/black.yaml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup Python
- uses: actions/setup-python@v1
+ uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
deleted file mode 100644
index 95c672b..0000000
--- a/.github/workflows/linux.yml
+++ /dev/null
@@ -1,103 +0,0 @@
-name: Build Linux Wheels
-on:
- push:
- pull_request:
- create:
-
-jobs:
- build:
- # We want to run on external PRs, but not on our own internal PRs as they'll be run
- # by the push to the branch.
- if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
-
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v1
-
- - name: Set up Python 3.8
- uses: actions/setup-python@v1
- with:
- python-version: 3.8
-
- - name: Cythonize
- shell: bash
- run: |
- pip install -U pip
- pip -V
- pip install -r requirements.txt
- make cython
- #python setup.py sdist
-
- - name: Build wheels
- shell: bash
- run: |
- make linux-wheel
-
- - name: Install qemu-user-static for docker
- shell: bash
- run: |
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
-
- - name: Build arm64 wheels
- shell: bash
- run: |
- make linux-arm64-wheel
-
- - name: Run test (3.8)
- run: |
- pip install pytest
- pip install -v msgpack --only-binary :all: --no-index -f dist/wheelhouse
- pytest -v test
-
-
- - name: Set up Python 3.10
- uses: actions/setup-python@v1
- with:
- python-version: "3.10"
-
- - name: Run test (3.10)
- run: |
- pip install pytest
- pip install -v msgpack --only-binary :all: --no-index -f dist/wheelhouse
- pytest -v test
-
- - name: Set up Python 3.9
- uses: actions/setup-python@v1
- with:
- python-version: 3.9
-
- - name: Run test (3.9)
- run: |
- pip install pytest
- pip install -v msgpack --only-binary :all: --no-index -f dist/wheelhouse
- pytest -v test
-
- - name: Set up Python 3.7
- uses: actions/setup-python@v1
- with:
- python-version: 3.7
-
- - name: Run test (3.7)
- run: |
- pip install pytest
- pip install -v msgpack --only-binary :all: --no-index -f dist/wheelhouse
- pytest -v test
-
- - name: Set up Python 3.6
- uses: actions/setup-python@v1
- with:
- python-version: 3.6
-
- - name: Run test (3.6)
- run: |
- pip install pytest
- pip install -v msgpack --only-binary :all: --no-index -f dist/wheelhouse
- pytest -v test
-
-
- - name: Upload Wheels
- uses: actions/upload-artifact@v1
- with:
- name: linux-wheels
- path: ./dist/wheelhouse/
diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml
deleted file mode 100644
index 85844e7..0000000
--- a/.github/workflows/mac.yml
+++ /dev/null
@@ -1,80 +0,0 @@
-name: Build macOS Wheels
-on:
- push:
- create:
-
-jobs:
- build:
- runs-on: macos-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@v1
-
- # Python 3.9
- - name: Set up Python 3.9
- uses: actions/setup-python@v1
- with:
- python-version: "3.9"
-
- - name: Cythonize
- run: |
- pip install -U pip
- pip install -r requirements.txt
- make cython
-
- - name: Build wheels
- uses: pypa/cibuildwheel@v2.2.2
- env:
- CIBW_ARCHS_MACOS: x86_64 universal2
- CIBW_SKIP: pp*
-
- - name: Run test
- run: |
- ls wheelhouse/
- pip install pytest
- pip install -v msgpack --only-binary :all: -f wheelhouse/ --no-index
- pytest -v test
-
- # Python 3.10
- - name: Set up Python 3.10
- uses: actions/setup-python@v1
- with:
- python-version: "3.10"
-
- - name: Run test
- run: |
- pip install pytest
- pip install -v msgpack --only-binary :all: -f wheelhouse/ --no-index
- pytest -v test
-
- # Python 3.8
- - name: Set up Python 3.8
- uses: actions/setup-python@v1
- with:
- python-version: "3.8"
-
- - name: Run test
- run: |
- pip install pytest
- pip install -v msgpack --only-binary :all: -f wheelhouse/ --no-index
- pytest -v test
-
- # Python 3.7
- - name: Set up Python 3.7
- uses: actions/setup-python@v1
- with:
- python-version: "3.7"
-
- - name: Run test
- run: |
- pip install pytest
- pip install -v msgpack --only-binary :all: -f wheelhouse/ --no-index
- pytest -v test
-
-
- - name: Upload Wheels
- uses: actions/upload-artifact@v1
- with:
- name: macos-wheels
- path: ./wheelhouse/
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..6e497e0
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,45 @@
+name: Run tests
+on:
+ push:
+ branches: [main]
+ pull_request:
+ create:
+
+jobs:
+ test:
+ strategy:
+ matrix:
+ os: [ubuntu-20.04, windows-2022, macos-10.15]
+ py: ["3.10", "3.9", "3.8", "3.7", "3.6"]
+
+ runs-on: ${{ matrix.os }}
+ name: Run test with Python ${{ matrix.py }} on ${{ matrix.os }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.py }}
+ cache: "pip"
+
+ - name: Build
+ shell: bash
+ run: |
+ pip install -U pip
+ pip install -r requirements.txt pytest
+ make cython
+ pip install .
+
+ - name: Test (C extension)
+ shell: bash
+ run: |
+ pytest -v test
+
+ - name: Test (pure Python fallback)
+ shell: bash
+ run: |
+ MSGPACK_PUREPYTHON=1 pytest -v test
+
diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml
new file mode 100644
index 0000000..5627b5f
--- /dev/null
+++ b/.github/workflows/wheel.yml
@@ -0,0 +1,51 @@
+name: Build Wheels
+on:
+ push:
+ branches: [main]
+ create:
+
+jobs:
+ build_wheels:
+ strategy:
+ matrix:
+ os: [ubuntu-20.04, windows-2022, macos-10.15]
+ runs-on: ${{ matrix.os }}
+ name: Build wheels on ${{ matrix.os }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Set up QEMU
+ if: runner.os == 'Linux'
+ uses: docker/setup-qemu-action@v1
+ with:
+ platforms: arm64
+
+ - name: Set up Python 3.9
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.9
+ cache: "pip"
+
+ - name: Prepare
+ shell: bash
+ run: |
+ pip install -r requirements.txt
+ make cython
+
+ - name: Build
+ uses: pypa/cibuildwheel@v2.2.2
+ env:
+ CIBW_TEST_REQUIRES: "pytest"
+ CIBW_TEST_COMMAND: "pytest {package}/test"
+ CIBW_ARCHS_LINUX: auto aarch64
+ CIBW_ARCHS_MACOS: x86_64 universal2 arm64
+ CIBW_SKIP: pp*
+
+ - name: Upload Wheels
+ uses: actions/upload-artifact@v1
+ with:
+ name: Wheels
+ path: wheelhouse
+
diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml
deleted file mode 100644
index 0ce50f5..0000000
--- a/.github/workflows/windows.yaml
+++ /dev/null
@@ -1,99 +0,0 @@
-name: Build and test windows wheels
-on:
- push:
- pull_request:
- create:
-
-jobs:
- build:
- # We want to run on external PRs, but not on our own internal PRs as they'll be run
- # by the push to the branch.
- if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
-
- runs-on: windows-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v1
-
- - name: Cythonize
- shell: bash
- run: |
- pip install -U Cython
- make cython
- #python setup.py sdist
-
- - name: Python 3.6 (amd64)
- env:
- PYTHON: "py -3.6-64"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.6 (x86)
- env:
- PYTHON: "py -3.6-32"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.7 (amd64)
- env:
- PYTHON: "py -3.7-64"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.7 (x86)
- env:
- PYTHON: "py -3.7-32"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.8 (amd64)
- env:
- PYTHON: "py -3.8-64"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.8 (x86)
- env:
- PYTHON: "py -3.8-32"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.9 (amd64)
- env:
- PYTHON: "py -3.9-64"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.9 (x86)
- env:
- PYTHON: "py -3.9-32"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.10 (amd64)
- env:
- PYTHON: "py -3.10-64"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Python 3.10 (x86)
- env:
- PYTHON: "py -3.10-32"
- shell: bash
- run: |
- ci/runtests.sh
-
- - name: Upload Wheels
- uses: actions/upload-artifact@v1
- with:
- name: win-wheels
- path: ./dist