Skip to content

Commit 9423b8d

Browse files
committed
use Github Actions for CI
1 parent 4e059b9 commit 9423b8d

File tree

7 files changed

+236
-10
lines changed

7 files changed

+236
-10
lines changed

.github/workflows/ci.yml

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
name: GitHub CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
container: ${{ matrix.container }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- name: py2.6
18+
os: ubuntu-latest
19+
container: centos:6
20+
python-version: 2.6
21+
tox-env: py26
22+
- name: py2.7
23+
os: ubuntu-16.04
24+
python-version: 2.7
25+
tox-env: py27
26+
- name: py2.7 with old gmpy
27+
os: ubuntu-16.04
28+
python-version: 2.7
29+
tox-env: py27_old_gmpy
30+
- name: py2.7 with old gmpy2
31+
os: ubuntu-16.04
32+
python-version: 2.7
33+
tox-env: py27_old_gmpy2
34+
- name: py2.7 with old six
35+
os: ubuntu-16.04
36+
python-version: 2.7
37+
tox-env: py27_old_six
38+
- name: py2.7 with gmpy
39+
os: ubuntu-16.04
40+
python-version: 2.7
41+
tox-env: gmpypy27
42+
- name: py2.7 with gmpy2
43+
os: ubuntu-16.04
44+
python-version: 2.7
45+
tox-env: gmpy2py27
46+
- name: py3.3
47+
os: ubuntu-18.04
48+
python-version: 3.3
49+
tox-env: py33
50+
- name: py3.4
51+
os: ubuntu-18.04
52+
python-version: 3.4
53+
tox-env: py34
54+
- name: py3.5
55+
os: ubuntu-18.04
56+
python-version: 3.5
57+
tox-env: py35
58+
- name: py3.6
59+
os: ubuntu-18.04
60+
python-version: 3.6
61+
tox-env: py36
62+
- name: py3.7
63+
os: ubuntu-latest
64+
python-version: 3.7
65+
tox-env: py37
66+
- name: py3.8
67+
os: ubuntu-latest
68+
python-version: 3.8
69+
tox-env: py38
70+
- name: py3.9
71+
os: ubuntu-latest
72+
python-version: 3.9
73+
tox-env: py39
74+
- name: py3.9 with gmpy
75+
os: ubuntu-latest
76+
python-version: 3.9
77+
tox-env: gmpypy39
78+
- name: py3.9 with gmpy2
79+
os: ubuntu-latest
80+
python-version: 3.9
81+
tox-env: gmpy2py39
82+
- name: pypy
83+
os: ubuntu-latest
84+
python-version: pypy-2.7
85+
tox-env: pypy
86+
- name: pypy3
87+
os: ubuntu-latest
88+
python-version: pypy-3.7
89+
tox-env: pypy3
90+
# special configurations
91+
- name: py2.7 with instrumental
92+
os: ubuntu-16.04
93+
python-version: 2.7
94+
opt-deps: ['instrumental']
95+
- name: code checks
96+
os: ubuntu-latest
97+
python-version: 3.9
98+
tox-env: codechecks
99+
steps:
100+
- uses: actions/checkout@v2
101+
if: ${{ !matrix.container }}
102+
with:
103+
fetch-depth: 50
104+
- uses: actions/checkout@v1
105+
# centos 6 doesn't have glibc new enough for the nodejs used by v2
106+
if: ${{ matrix.container }}
107+
with:
108+
fetch-depth: 50
109+
- name: Ensure dependencies on CentOS
110+
if: ${{ matrix.container }}
111+
run: |
112+
ls /etc/yum.repos.d/
113+
cat /etc/yum.repos.d/CentOS-Base.repo
114+
rm /etc/yum.repos.d/CentOS-Base.repo
115+
cat > /etc/yum.repos.d/CentOS-Base.repo <<EOF
116+
[base]
117+
name=CentOS-$releasever - Base
118+
baseurl=https://vault.centos.org/6.10/os/x86_64/
119+
gpgcheck=1
120+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
121+
122+
[updates]
123+
name=CentOS-$releasever - Updates
124+
baseurl=https://vault.centos.org/6.10/updates/x86_64/
125+
gpgcheck=1
126+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
127+
128+
[extras]
129+
name=CentOS-$releasever - Extras
130+
baseurl=https://vault.centos.org/6.10/extras/x86_64/
131+
gpgcheck=1
132+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
133+
134+
EOF
135+
echo installing
136+
yum clean all
137+
yum repolist all
138+
yum install -y git make python curl gcc libffi-devel python-devel glibc-devel openssl-devel
139+
- name: Verify git status
140+
run: |
141+
git status
142+
git remote -v
143+
- name: Ensure we have baseline branch for quality coverage
144+
run: git fetch origin master:refs/remotes/origin/master
145+
- name: Set up Python ${{ matrix.python-version }}
146+
# we use containers to use the native python version from them
147+
if: ${{ !matrix.container }}
148+
uses: actions/setup-python@v2
149+
with:
150+
python-version: ${{ matrix.python-version }}
151+
- name: Display Python version
152+
run: python -c "import sys; print(sys.version)"
153+
- name: Display installed python package versions
154+
run: |
155+
pip list || :
156+
- name: Ensure working pip on 3.3
157+
if: ${{ matrix.python-version == '3.3' }}
158+
run: |
159+
curl -o get-pip.py https://bootstrap.pypa.io/3.3/get-pip.py;
160+
python get-pip.py
161+
- name: Ensure working pip on 2.6
162+
if: ${{ matrix.python-version == '2.6' }}
163+
run: |
164+
curl -o get-pip.py https://bootstrap.pypa.io/2.6/get-pip.py;
165+
python get-pip.py
166+
pip list
167+
pip install setuptools==28.8.0 wheel==0.30.0a0
168+
- name: Install instrumental
169+
if: ${{ contains(matrix.tox-env, 'instrumental') }}
170+
run: pip install instrumental
171+
- name: Install gmpy
172+
if: ${{ contains(matrix.tox-env, 'gmpy') }}
173+
run: pip install gmpy
174+
- name: Install gmpy2 dependencies
175+
if: ${{ contains(matrix.tox-env, 'gmpy2') }}
176+
run: sudo apt-get install -y libmpfr-dev libmpc-dev
177+
- name: Install gmpy2
178+
if: ${{ contains(matrix.tox-env, 'gmpy2') }}
179+
run: pip install gmpy2
180+
- name: Install build dependencies
181+
run: |
182+
PYTHON_VERSION=${{ matrix.python-version }}
183+
PYTHON_VERSION=${PYTHON_VERSION#pypy-}
184+
if [[ -e build-requirements-${PYTHON_VERSION}.txt ]]; then
185+
pip install -r build-requirements-${PYTHON_VERSION}.txt;
186+
else
187+
pip install -r build-requirements.txt;
188+
fi
189+
- name: Display installed python package versions
190+
run: pip list
191+
- name: Run unit tests
192+
if: ${{ matrix.tox-env }}
193+
run: tox -e ${{ matrix.tox-env }}
194+
- name: Publish coverage to Coveralls
195+
if: ${{ !matrix.opt-deps && matrix.tox-env != 'codechecks' }}
196+
env:
197+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198+
COVERALLS_FLAG_NAME: ${{ matrix.name }}
199+
COVERALLS_PARALLEL: true
200+
COVERALLS_SERVICE_NAME: github
201+
run: coveralls
202+
203+
coveralls:
204+
name: Indicate completion to coveralls.io
205+
needs: test
206+
runs-on: ubuntu-latest
207+
container: python:3-slim
208+
steps:
209+
- name: Install coveralls
210+
run: |
211+
pip3 install --upgrade coveralls
212+
- name: Send "finished" signal to coveralls
213+
env:
214+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
215+
COVERALLS_SERVICE_NAME: github
216+
run: |
217+
coveralls --finish

build-requirements-2.6.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
tox
2-
coveralls<1.3.0
2+
inflect<0.3.1
3+
pyopenssl<18
4+
cffi<1.14
5+
git+https://github.com/tomato42/coveralls-python.git@add-py26#egg=coveralls
36
idna<2.8
47
unittest2
58
hypothesis<3
6-
coverage==4.5.4
9+
coverage
10+
mock==2.0.0

build-requirements-2.7.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
tox
2+
git+https://github.com/tomato42/coveralls-python.git@add-py26#egg=coveralls
3+
hypothesis
4+
pytest>=4.6.0
5+
coverage

build-requirements-3.3.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
python-coveralls
1+
git+https://github.com/tomato42/coveralls-python.git@add-py26#egg=coveralls
22
pluggy<0.6
33
tox<3
44
wheel<0.30
55
virtualenv==15.2.0
66
enum34
77
hypothesis<3.44
8-
coverage==4.5.4
8+
coverage<5.0
99
urllib3<=1.25.8

build-requirements-3.4.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tox
2-
python-coveralls
2+
git+https://github.com/tomato42/coveralls-python.git@add-py26#egg=coveralls
33
hypothesis
44
pytest>=4.6.0
55
PyYAML<5.3
6-
coverage==4.5.4
6+
coverage

build-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tox
2-
python-coveralls
2+
coveralls
33
hypothesis
44
pytest>=4.6.0
5-
coverage==4.5.4
5+
coverage

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ deps =
3131
py: pytest
3232
py: hypothesis
3333
py{33}: wheel<0.30
34-
coverage==4.5.4
34+
coverage
3535
commands = coverage run --branch -m pytest {posargs:src/ecdsa}
3636

3737
[testenv:py27_old_gmpy]
@@ -62,7 +62,7 @@ deps =
6262
instrumental
6363
hypothesis
6464
pytest>=4.6.0
65-
coverage==4.5.4
65+
coverage
6666
six
6767
commands =
6868
instrumental -t ecdsa -i 'test.*|.*_version|.*_compat' {envbindir}/pytest {posargs:src/ecdsa}

0 commit comments

Comments
 (0)