-
Notifications
You must be signed in to change notification settings - Fork 59
195 lines (187 loc) · 5.09 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# 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:
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install Flake8
run: |
pip install flake8
- name: Run Flake8
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: flake8
run: flake8 .
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 pytest
pip install -e .
- name: MyPy
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: mypy
run: mypy --show-column-numbers delocate/
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Black
run: pip install black
- name: Run black
run: black . --check --diff
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install isort
run: pip install isort
- name: Run isort
run: isort . --check --diff
tests:
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