From bf953febd3e6a644a2a4047286701098a77e53cc Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 3 Dec 2019 16:56:52 +0900 Subject: [PATCH 1/3] Use Github Actions for Windows --- .github/workflows/windows.yaml | 48 ++++++++++++++++++++++++++++++++++ ci/runtests.bat | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/windows.yaml diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml new file mode 100644 index 00000000..65365966 --- /dev/null +++ b/.github/workflows/windows.yaml @@ -0,0 +1,48 @@ +name: Build and test windows wheels +on: + push: + branches: + - master + - test + pull_request: + create: + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Install Dependencies + shell: bash + run: | + pip install -U Cython setuptools wheel pytest + make cython + #python setup.py sdist + + - name: Python 3.6 (amd64) + shell: bash + run: | + py -3.6-64 -VV + py -3.6-64 -m pip install setuptools wheel pytest + py -3.6-64 setup.py build_ext -if + py -3.6-64 -c "from msgpack import _cmsgpack" + py -3.6-64 setup.py bdist_wheel + py -3.6-64 -m pytest -v test + + - name: Python 3.6 (x86) + shell: bash + run: | + py -3.6-32 -VV + py -3.6-32 -m pip install setuptools wheel pytest + py -3.6-32 setup.py build_ext -if + py -3.6-32 -c "from msgpack import _cmsgpack" + py -3.6-32 setup.py bdist_wheel + py -3.6-32 -m pytest -v test + + - name: Upload Wheels + uses: actions/upload-artifact@v1 + with: + name: win-wheels + path: ./dist diff --git a/ci/runtests.bat b/ci/runtests.bat index 02404679..4ae2f708 100644 --- a/ci/runtests.bat +++ b/ci/runtests.bat @@ -2,7 +2,7 @@ %PYTHON%\python.exe setup.py build_ext -i %PYTHON%\python.exe setup.py install %PYTHON%\python.exe -c "import sys; print(hex(sys.maxsize))" -%PYTHON%\python.exe -c "from msgpack import _packer, _unpacker" +%PYTHON%\python.exe -c "from msgpack import _cmsgpack" %PYTHON%\python.exe setup.py bdist_wheel %PYTHON%\python.exe -m pytest -v test SET EL=%ERRORLEVEL% From 9ecc960f36e9f8c8f055725ebe0d6bf8142d68f2 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 3 Dec 2019 17:30:22 +0900 Subject: [PATCH 2/3] more Pythons --- .github/workflows/windows.yaml | 54 ++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 65365966..6e954f65 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -14,32 +14,54 @@ jobs: - name: Checkout uses: actions/checkout@v1 - - name: Install Dependencies + - name: Cythonize shell: bash run: | - pip install -U Cython setuptools wheel pytest + pip install -U Cython make cython #python setup.py sdist - name: Python 3.6 (amd64) + env: + PYTHON: "py -3.6-64" shell: bash - run: | - py -3.6-64 -VV - py -3.6-64 -m pip install setuptools wheel pytest - py -3.6-64 setup.py build_ext -if - py -3.6-64 -c "from msgpack import _cmsgpack" - py -3.6-64 setup.py bdist_wheel - py -3.6-64 -m pytest -v test + run: &testscript | + ${PYTHON} -VV + ${PYTHON} -m pip install setuptools wheel pytest + ${PYTHON} setup.py build_ext -if + ${PYTHON} -c "from msgpack import _cmsgpack" + ${PYTHON} setup.py bdist_wheel + ${PYTHON} -m pytest -v test - name: Python 3.6 (x86) + env: + PYTHON: "py -3.6-32" shell: bash - run: | - py -3.6-32 -VV - py -3.6-32 -m pip install setuptools wheel pytest - py -3.6-32 setup.py build_ext -if - py -3.6-32 -c "from msgpack import _cmsgpack" - py -3.6-32 setup.py bdist_wheel - py -3.6-32 -m pytest -v test + run: *testscript + + - name: Python 3.7 (amd64) + env: + PYTHON: "py -3.7-64" + shell: bash + run: *testscript + + - name: Python 3.7 (x86) + env: + PYTHON: "py -3.7-32" + shell: bash + run: *testscript + + - name: Python 3.8 (amd64) + env: + PYTHON: "py -3.8-64" + shell: bash + run: *testscript + + - name: Python 3.8 (x86) + env: + PYTHON: "py -3.8-32" + shell: bash + run: *testscript - name: Upload Wheels uses: actions/upload-artifact@v1 From 0e155a004b7adfff7aeae6a14770903eff92f42c Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 3 Dec 2019 17:38:00 +0900 Subject: [PATCH 3/3] Use test script --- .github/workflows/windows.yaml | 24 ++++++++++++------------ ci/runtests.sh | 8 ++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 ci/runtests.sh diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 6e954f65..cecb8258 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -25,43 +25,43 @@ jobs: env: PYTHON: "py -3.6-64" shell: bash - run: &testscript | - ${PYTHON} -VV - ${PYTHON} -m pip install setuptools wheel pytest - ${PYTHON} setup.py build_ext -if - ${PYTHON} -c "from msgpack import _cmsgpack" - ${PYTHON} setup.py bdist_wheel - ${PYTHON} -m pytest -v test + run: | + ci/runtests.sh - name: Python 3.6 (x86) env: PYTHON: "py -3.6-32" shell: bash - run: *testscript + run: | + ci/runtests.sh - name: Python 3.7 (amd64) env: PYTHON: "py -3.7-64" shell: bash - run: *testscript + run: | + ci/runtests.sh - name: Python 3.7 (x86) env: PYTHON: "py -3.7-32" shell: bash - run: *testscript + run: | + ci/runtests.sh - name: Python 3.8 (amd64) env: PYTHON: "py -3.8-64" shell: bash - run: *testscript + run: | + ci/runtests.sh - name: Python 3.8 (x86) env: PYTHON: "py -3.8-32" shell: bash - run: *testscript + run: | + ci/runtests.sh - name: Upload Wheels uses: actions/upload-artifact@v1 diff --git a/ci/runtests.sh b/ci/runtests.sh new file mode 100644 index 00000000..5d87f696 --- /dev/null +++ b/ci/runtests.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -ex +${PYTHON} -VV +${PYTHON} -m pip install setuptools wheel pytest +${PYTHON} setup.py build_ext -if +${PYTHON} -c "from msgpack import _cmsgpack" +${PYTHON} setup.py bdist_wheel +${PYTHON} -m pytest -v test