Skip to content

Commit bdf0511

Browse files
authored
Refactor CI (#492)
* Use cibuildwheel to build wheels. * Use matrix
1 parent 6129789 commit bdf0511

File tree

11 files changed

+100
-441
lines changed

11 files changed

+100
-441
lines changed

Diff for: .github/workflows/black.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Setup Python
14-
uses: actions/setup-python@v1
14+
uses: actions/setup-python@v2
1515
with:
1616
python-version: '3.x'
1717
architecture: 'x64'

Diff for: .github/workflows/linux.yml

-103
This file was deleted.

Diff for: .github/workflows/mac.yml

-80
This file was deleted.

Diff for: .github/workflows/test.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Run tests
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
create:
7+
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
os: [ubuntu-20.04, windows-2022, macos-10.15]
13+
py: ["3.10", "3.9", "3.8", "3.7", "3.6"]
14+
15+
runs-on: ${{ matrix.os }}
16+
name: Run test with Python ${{ matrix.py }} on ${{ matrix.os }}
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.py }}
26+
cache: "pip"
27+
28+
- name: Build
29+
shell: bash
30+
run: |
31+
pip install -U pip
32+
pip install -r requirements.txt pytest
33+
make cython
34+
pip install .
35+
36+
- name: Test (C extension)
37+
shell: bash
38+
run: |
39+
pytest -v test
40+
41+
- name: Test (pure Python fallback)
42+
shell: bash
43+
run: |
44+
MSGPACK_PUREPYTHON=1 pytest -v test
45+

Diff for: .github/workflows/wheel.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Wheels
2+
on:
3+
push:
4+
branches: [main]
5+
create:
6+
7+
jobs:
8+
build_wheels:
9+
strategy:
10+
matrix:
11+
os: [ubuntu-20.04, windows-2022, macos-10.15]
12+
runs-on: ${{ matrix.os }}
13+
name: Build wheels on ${{ matrix.os }}
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Set up QEMU
20+
if: runner.os == 'Linux'
21+
uses: docker/setup-qemu-action@v1
22+
with:
23+
platforms: arm64
24+
25+
- name: Set up Python 3.9
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: 3.9
29+
cache: "pip"
30+
31+
- name: Prepare
32+
shell: bash
33+
run: |
34+
pip install -r requirements.txt
35+
make cython
36+
37+
- name: Build
38+
uses: pypa/[email protected]
39+
env:
40+
CIBW_TEST_REQUIRES: "pytest"
41+
CIBW_TEST_COMMAND: "pytest {package}/test"
42+
CIBW_ARCHS_LINUX: auto aarch64
43+
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
44+
CIBW_SKIP: pp*
45+
46+
- name: Upload Wheels
47+
uses: actions/upload-artifact@v1
48+
with:
49+
name: Wheels
50+
path: wheelhouse
51+

Diff for: .github/workflows/windows.yaml

-99
This file was deleted.

0 commit comments

Comments
 (0)