-
Notifications
You must be signed in to change notification settings - Fork 59
171 lines (165 loc) · 4.6 KB
/
python-package.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Builds wheels and libraries used to run tests, uploads them, then runs the standard tests.
name: Python Package
on:
push:
pull_request:
defaults:
run:
shell: bash
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- uses: pre-commit/action@v3.0.0
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install MyPy
run: |
pip install mypy
- name: Install Delocate dependencies.
run: |
pip install --requirement test-requirements.txt
pip install --editable .
- name: MyPy
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: mypy
run: mypy --show-column-numbers delocate/
tests:
needs: [pre-commit, mypy]
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "12.4"
- name: Workaround ARM64 issues
# https://github.com/actions/virtual-environments/issues/2557
run: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Build libs and wheels
# Use a venv from multibuild for this step.
run: |
source multibuild/osx_utils.sh
get_macpython_environment $MB_PYTHON_VERSION venv
make
env:
MB_PYTHON_VERSION: "3.9"
MB_PYTHON_OSX_VER: "10.9"
- name: Upload test data
uses: actions/upload-artifact@v3
with:
name: delocate-tests-data
path: |
delocate/tests/data/
retention-days: 3
if-no-files-found: error
- name: Install test dependencies
run: |
pip install -r test-requirements.txt build
- name: Build delocate
run: |
python -m build
- name: Install delocate
run: |
pip install -e .
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: delocate-wheel
path: |
dist/delocate-*.whl
retention-days: 3
if-no-files-found: error
- name: Upload requirements
uses: actions/upload-artifact@v3
with:
name: test-requirements
path: |
test-requirements.txt
retention-days: 3
if-no-files-found: error
- name: Run tests
run: |
pytest
- name: Collect code coverage data
run: |
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: "624762bf-aaf0-4a75-b450-16f5ebece0b1"
isolated_tests:
needs: tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: "macos-11"
xcode: "12.4"
python: "3.x"
- os: "macos-11"
xcode: "13.0"
python: "3.x"
- os: "macos-12"
xcode: "14.0"
python: "3.x"
- os: "macos-13"
xcode: "14.2"
python: "3.x"
- os: "ubuntu-latest"
python: "3.7"
- os: "ubuntu-latest"
python: "3.8"
- os: "ubuntu-latest"
python: "3.9"
- os: "ubuntu-latest"
python: "3.10"
- os: "ubuntu-latest"
python: "3.11"
- os: "windows-latest"
python: "3.x"
steps:
- if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- if: runner.os == 'macOS'
name: Check otool version
run: otool --version
- name: Download wheel
uses: actions/download-artifact@v3
with:
name: delocate-wheel
- name: Install delocate
run: |
pip install delocate-*.whl
- name: Download requirements
uses: actions/download-artifact@v3
with:
name: test-requirements
- name: Install test dependencies
run: |
pip install -r test-requirements.txt
- name: Run isolated tests
run: |
pytest --pyargs delocate --log-level DEBUG --doctest-modules