-
Notifications
You must be signed in to change notification settings - Fork 19
137 lines (121 loc) · 4.14 KB
/
tests.yml
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: tests
on:
push:
paths:
- src/**
- test/**
- setup.py
- requirements.txt
- Makefile
pull_request:
workflow_dispatch:
jobs:
run-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python: [ '3.8', '3.9', 'pypy-3.9', '3.10', '3.11', '3.12', '3.13' ]
include:
- os: macos-13
python: '3.8'
- os: macos-13
python: '3.9'
- os: macos-13
python: 'pypy-3.9'
- os: macos-13
python: '3.10'
- os: macos-13
python: '3.11'
exclude:
- os: macos-latest # Python 3.8 unavailable on macos-14
python: '3.8'
- os: macos-latest # Python 3.9 unavailable on macos-14
python: '3.9'
steps:
- uses: actions/checkout@v4
- name: select Xcode version
# MacOS > 14.2 requires Xcode >= 15.3; otherwise loading native extension modules fails with e.g.:
# dlopen(/opt/homebrew/lib/python3.11/site-packages/slipcover/probe.abi3.so, 0x0002): bad bind opcode 0x00
if: startsWith(matrix.os, 'macos-')
run: |
if [ -d /Applications/Xcode_15.3.app/Contents/Developer ]; then sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer; fi
clang++ --version
g++ --version
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: install prereqs
run: |
python3 -m pip install -U pip # to avoid warnings
python3 -m pip install pytest
- name: install SlipCover (non-pypy)
if: "! startsWith(matrix.python, 'pypy-')"
run: |
python3 -m pip install .
- name: install SlipCover (pypy)
if: startsWith(matrix.python, 'pypy-')
run: |
LDSHARED="g++ -shared" python3 -m pip install .
- name: install Unix dependencies
if: matrix.os != 'windows-latest'
run: python3 -m pip install pytest-forked
- name: run tests
run: python3 -m pytest
# Test building from source distribution
test-build-from-source:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
python_tag: ['cp311', 'pp39']
include:
- os: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64 # https://github.com/pypa/manylinux
steps:
- uses: actions/checkout@v4
- name: set up python
run: |
PYT=`echo "${{ matrix.python_tag }}" | tr -d "."`; ls -d -1 /opt/python/$PYT-*/bin | head -n 1 >> $GITHUB_PATH
cat $GITHUB_PATH
- name: install dependencies
run: |
python3 -m pip install --upgrade pip # to avoid warnings
python3 -m pip install wheel
- name: build sdist
run: |
python3 setup.py sdist
- name: try to use it
run: |
tar xzf dist/slipcover*.tar.gz
cd slipcover*
python3 setup.py build
# Run a manylinux wheel build to verify build configuration
test-build-wheel-manylinux:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
python_version: ['3.8', '3.9', '3.10', '3.11'] # 3.12+ are "pure Python", no need to build on manylinux
include:
- os: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64 # https://github.com/pypa/manylinux
steps:
- uses: actions/checkout@v4
- name: set up python
run: |
PYV=`echo "${{ matrix.python_version }}" | tr -d "."`; ls -d -1 /opt/python/cp$PYV*/bin | head -n 1 >> $GITHUB_PATH
cat $GITHUB_PATH
- name: install dependencies
run: |
python3 -m pip install --upgrade pip # otherwise building 'cryptography' may fail
python3 -m pip install setuptools wheel twine
- name: build wheel
run: |
python3 setup.py bdist_wheel
- name: run auditwheel for manylinux
run: |
auditwheel repair dist/*.whl
rm -f dist/*.whl
mv wheelhouse/*.whl dist/