Repository navigation
104 lines (95 loc) · 3.02 KB
/
Copy pathbuild.yml
File metadata and controls
104 lines (95 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Runs CI tests and generates wheels on the following platforms:
# * Linux
# * macOS
# * Windows
#
# Useful URLs:
# * https://github.com/pypa/cibuildwheel
# * https://github.com/actions/checkout
# * https://github.com/actions/setup-python
# * https://github.com/actions/upload-artifact
on: [push, pull_request]
name: build
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }}
cancel-in-progress: true
jobs:
# Run tests on Linux, macOS, Windows
tests:
name: "${{ matrix.os }}, ${{ matrix.arch }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
include:
- { os: ubuntu-latest, arch: x86_64 }
- { os: ubuntu-24.04-arm, arch: aarch64 }
- { os: macos-15, arch: x86_64 }
- { os: macos-15, arch: arm64 }
- { os: windows-2025, arch: AMD64 }
- { os: windows-11-arm, arch: ARM64 }
steps:
- uses: actions/checkout@v5
# Install Python 3.8 on macOS ARM64 for universal2 support, else 3.11
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: ${{ runner.os == 'macOS' && runner.arch == 'ARM64' && '3.8' || '3.11' }}
- name: Build wheels + run tests
uses: pypa/cibuildwheel@v3.2.1
env:
CIBW_ARCHS: "${{ matrix.arch }}"
CIBW_ENABLE: "cpython-freethreading ${{ startsWith(github.ref, 'refs/tags/') && '' || 'cpython-prerelease' }}"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: wheelhouse
# Test python 2.7 fallback installation message produced by setup.py
py2-fallback:
name: py2.7 setup.py check
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
- uses: LizardByte/actions/actions/setup_python@master
with:
python-version: 2.7
- run: python scripts/internal/test_python2_setup_py.py
# Run linters.
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: 3.x
- name: "Run linters"
run: |
make ci-lint
# Produce wheels as artifacts.
upload-wheels:
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact/merge@v4
with:
name: wheels
pattern: wheels-*
separate-directories: false
delete-merged: true
# Check sanity of the package distribution (.tar.gz and *.whl files)
check-dist:
needs: [upload-wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: 3.x
- uses: actions/download-artifact@v4
with:
name: wheels
path: wheelhouse
- run: |
make ci-check-dist