-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (148 loc) · 3.86 KB
/
pythonpackage.yml
File metadata and controls
156 lines (148 loc) · 3.86 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
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
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ created ]
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build manylinux image
run: |
docker build -t manylinux manylinux
- name: Build python wheels
run: |
docker run -t -v $PWD:/github/workspace manylinux
- uses: actions/upload-artifact@v1
with:
name: wheels
path: wheelhouse
test:
runs-on: 'ubuntu-latest'
needs: build
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v1
with:
name: wheels
path: wheelhouse
- name: Install wheel
run: |
PYTHON_VERSION=${{ matrix.python-version }}
pip install wheelhouse/*-cp${PYTHON_VERSION//./}*
- name: Install dev dependencies
run: |
pip install -r dev-requirements.txt
- name: Lint with flake8
if: ${{ matrix.python-version == '3.6' }}
run: |
flake8
- name: Check types with mypy
if: ${{ matrix.python-version == '3.6' }}
run: |
mypy
- name: Test with pytest
run: |
mv abieos _abieos
pytest --cov --cov-report xml
- name: Upload coverage
if: ${{ matrix.python-version == '3.6' }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ./coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
build_abieos_macos:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build abieos
run: |
cd external/abieos
mkdir build
cd build
cmake ..
make
- uses: actions/upload-artifact@v1
with:
name: abieos-macos
path: external/abieos/build
build_package_macos:
runs-on: macos-10.15
needs: build_abieos_macos
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/download-artifact@v1
with:
name: abieos-macos
path: external/abieos/build
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build library
run: |
pip install wheel
python setup.py build --static
python setup.py sdist bdist bdist_wheel
- uses: actions/upload-artifact@v1
with:
name: dist-macos-${{ matrix.python-version }}
path: dist
deploy:
if: ${{ github.event_name == 'release' }}
needs:
- test
- build_package_macos
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/download-artifact@v1
with:
name: wheels
path: wheelhouse
- uses: actions/download-artifact@v1
with:
name: dist-macos-3.6
path: dist
- uses: actions/download-artifact@v1
with:
name: dist-macos-3.7
path: dist
- uses: actions/download-artifact@v1
with:
name: dist-macos-3.8
path: dist
- name: 'Install twine'
run: |
pip install --upgrade pip twine
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/* wheelhouse/*.whl || true