Skip to content

Commit dbdacd9

Browse files
committed
Github actions for Linux
1 parent f374be7 commit dbdacd9

File tree

5 files changed

+71
-12
lines changed

5 files changed

+71
-12
lines changed

.github/workflows/linux.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Linux
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
env:
8+
PREFIX: "${{ github.workspace }}/../venv"
9+
LIBGIT2_VERSION: 1.1.0
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-20.04
14+
strategy:
15+
matrix:
16+
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
17+
18+
steps:
19+
- name: Build libssh2
20+
run: |
21+
wget https://www.libssh2.org/download/libssh2-1.9.0.tar.gz
22+
tar xf libssh2-1.9.0.tar.gz
23+
cd libssh2-1.9.0
24+
./configure --prefix=$PREFIX --disable-static
25+
make
26+
make install
27+
28+
- name: Build libgit2
29+
env:
30+
CMAKE_PREFIX_PATH: "${{ env.PREFIX }}"
31+
run: |
32+
wget https://github.com/libgit2/libgit2/releases/download/v$LIBGIT2_VERSION/libgit2-$LIBGIT2_VERSION.tar.gz
33+
tar xf libgit2-$LIBGIT2_VERSION.tar.gz
34+
cd libgit2-$LIBGIT2_VERSION
35+
cmake . -DBUILD_CLAR=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX
36+
cmake --build . --target install
37+
38+
- name: Set up Python
39+
uses: actions/setup-python@v2
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Checkout pygit2
44+
uses: actions/checkout@v2
45+
46+
- name: Build pygit2
47+
env:
48+
LIBGIT2: "${{ env.PREFIX }}"
49+
run: |
50+
python setup.py egg_info
51+
pip install -r pygit2.egg-info/requires.txt
52+
pip install -r requirements-test.txt
53+
python setup.py build_ext --inplace
54+
55+
- name: Test
56+
env:
57+
LD_LIBRARY_PATH: "${{ env.PREFIX }}/lib:$LD_LIBRARY_PATH"
58+
run: |
59+
pytest

.github/workflows/macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
---
21
name: macOS
32

43
on:
5-
push: {}
4+
pull_request:
5+
push:
66

77
jobs:
88
build:

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ python:
1111
- "3.9"
1212

1313
arch:
14-
- amd64
1514
- arm64
1615

1716
env:
@@ -25,8 +24,6 @@ jobs:
2524
allow_failures:
2625
- arch: s390x
2726
include:
28-
- python: pypy3
29-
arch: amd64
3027
- python: 3.6
3128
arch: s390x
3229
- stage: &deploy_stage Publish to PyPI (runs only for tagged commits)

README.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ pygit2 - libgit2 bindings in Python
55
Bindings to the libgit2 shared library, implements Git plumbing.
66
Supports Python 3.6+ and PyPy3 7.3+
77

8-
.. image:: https://travis-ci.org/libgit2/pygit2.svg?branch=master
9-
:target: http://travis-ci.org/libgit2/pygit2
8+
.. image:: https://github.com/libgit2/pygit2/workflows/Linux/badge.svg
9+
:target: https://github.com/libgit2/pygit2/actions?query=workflow%3ALinux
10+
11+
.. image:: https://github.com/libgit2/pygit2/workflows/macOS/badge.svg
12+
:target: https://github.com/libgit2/pygit2/actions?query=workflow%3AmacOS
1013

1114
.. image:: https://ci.appveyor.com/api/projects/status/edmwc0dctk5nacx0/branch/master?svg=true
1215
:target: https://ci.appveyor.com/project/jdavid/pygit2/branch/master
1316

14-
.. image:: https://github.com/libgit2/pygit2/workflows/macOS/badge.svg
15-
:target: https://github.com/libgit2/pygit2/actions?query=workflow%3AmacOS
17+
.. image:: https://travis-ci.org/libgit2/pygit2.svg?branch=master
18+
:target: http://travis-ci.org/libgit2/pygit2
19+
1620

1721
Links
1822
=====================================

docs/install.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,13 @@ Install libgit2 (see we define the installation prefix):
211211
$ tar xzf libgit2-1.1.0.tar.gz
212212
$ cd libgit2-1.1.0/
213213
$ cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT2
214-
$ make
215-
$ make install
214+
$ cmake --build . --target install
216215
217216
Install pygit2:
218217

219218
.. code-block:: sh
220219
221-
$ export LDFLAGS="-Wl,-rpath='$LIBGIT2/lib',--enable-new-dtags $LDFLAGS"
220+
$ export LDFLAGS="-Wl,-rpath,'$LIBGIT2/lib',--enable-new-dtags $LDFLAGS"
222221
# on OSX: export LDFLAGS="-Wl,-rpath,'$LIBGIT2/lib' $LDFLAGS"
223222
$ pip install pygit2
224223
$ python -c 'import pygit2'

0 commit comments

Comments
 (0)