-
Notifications
You must be signed in to change notification settings - Fork 2
116 lines (110 loc) · 3.08 KB
/
python.yml
File metadata and controls
116 lines (110 loc) · 3.08 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
name: Python
on: [push]
jobs:
devel:
name: Development build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Prerequisites
run: |
sudo apt update
sudo apt install -y -o Acquire::Retries=50 \
autoconf-archive openssl xxd asn1c \
python3-pip python3-setuptools python3-cffi \
python3-coverage python3-pycodestyle \
python3-flake8
sudo pip3 install pylint
- name: Test
working-directory: python
run: |
./test.sh
- name: Coverage report
uses: codecov/codecov-action@v1
with:
file: python/coverage.xml
- name: Source distribution
working-directory: python
run: |
python3 setup.py sdist
- name: Upload distribution
uses: actions/upload-artifact@v1
with:
name: python-dist
path: python/dist
sdist:
name: Build from sdist
runs-on: ubuntu-latest
needs: devel
steps:
- name: Prerequisites
run: |
sudo apt update
sudo apt install -y -o Acquire::Retries=50 \
python3-pip python3-setuptools
- name: Download distribution
uses: actions/download-artifact@v1
with:
name: python-dist
- name: Install
run: |
sudo pip3 install python-dist/libcx-*.tar.gz
- name: Usage test
run: |
python3 -I -c 'import libcx'
sdist-extlibcx:
name: Build from sdist (with external libcx)
runs-on: ubuntu-latest
needs: devel
steps:
- name: Prerequisites
run: |
sudo apt update
sudo apt install -y -o Acquire::Retries=50 python3-setuptools
- name: Download distribution
uses: actions/download-artifact@v1
with:
name: python-dist
- name: Unpack
run: |
tar xvzf python-dist/libcx-*.tar.gz
ln -s libcx-* python
- name: Install C library
working-directory: python/dist-libcx
run: |
./configure
make
sudo make install
sudo ldconfig
- name: Delete C library source
working-directory: python
run: |
rm -rf dist-libcx MANIFEST.in
- name: Install
working-directory: python
run: |
python3 setup.py build
sudo python3 setup.py install
- name: Usage test
run: |
python3 -I -c 'import libcx'
pypi:
name: Publish
runs-on: ubuntu-latest
needs:
- devel
- sdist
- sdist-extlibcx
steps:
- name: Download distribution
uses: actions/download-artifact@v1
with:
name: python-dist
- name: Publish to PyPI
if: startsWith(github.event.ref, 'refs/tags/python-')
uses: pypa/gh-action-pypi-publish@master
with:
packages_dir: python-dist/
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}