Skip to content

Commit ab6a571

Browse files
committed
Refactor Linux CI
1 parent 8874575 commit ab6a571

4 files changed

Lines changed: 33 additions & 56 deletions

File tree

.github/workflows/linux.yml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ on:
55
push:
66

77
env:
8-
PREFIX: "${{ github.workspace }}/../venv"
9-
LIBGIT2_VERSION: 1.1.0
8+
LIBGIT2: "${{ github.workspace }}/ci/install"
109

1110
jobs:
1211
build:
@@ -16,36 +15,20 @@ jobs:
1615
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
1716

1817
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 }}"
18+
- name: Checkout pygit2
19+
uses: actions/checkout@v2
20+
21+
- name: Build libraries
22+
working-directory: ci
3123
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
24+
/bin/sh build.sh
3725
3826
- name: Set up Python
3927
uses: actions/setup-python@v2
4028
with:
4129
python-version: ${{ matrix.python-version }}
4230

43-
- name: Checkout pygit2
44-
uses: actions/checkout@v2
45-
4631
- name: Build pygit2
47-
env:
48-
LIBGIT2: "${{ env.PREFIX }}"
4932
run: |
5033
python setup.py egg_info
5134
pip install -r pygit2.egg-info/requires.txt
@@ -54,6 +37,6 @@ jobs:
5437
5538
- name: Test
5639
env:
57-
LD_LIBRARY_PATH: "${{ env.PREFIX }}/lib:$LD_LIBRARY_PATH"
40+
LD_LIBRARY_PATH: "${{ env.LIBGIT2 }}/lib:$LD_LIBRARY_PATH"
5841
run: |
5942
pytest

.travis.sh

Lines changed: 0 additions & 29 deletions
This file was deleted.

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ arch:
1515

1616
env:
1717
global:
18-
LIBGIT2: ~/install/
18+
LIBGIT2: ${TRAVIS_BUILD_DIR}/ci/install
1919
LD_LIBRARY_PATH: ${LIBGIT2}/lib:${LD_LIBRARY_PATH}
2020
LIBGIT2_VERSION: "1.1"
2121

@@ -71,7 +71,9 @@ jobs:
7171

7272
before_install:
7373
- sudo apt-get -y install cmake
74-
- ./.travis.sh "${LIBGIT2_VERSION}"
74+
- cd ci
75+
- /bin/sh build.sh
76+
- cd ..
7577

7678
install:
7779
- python setup.py egg_info

ci/build.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
LIBSSH2_VERSION=1.9.0
4+
LIBGIT2_VERSION=1.1.0
5+
6+
PREFIX=`realpath install`
7+
8+
wget https://www.libssh2.org/download/libssh2-$LIBSSH2_VERSION.tar.gz
9+
tar xf libssh2-$LIBSSH2_VERSION.tar.gz
10+
cd libssh2-$LIBSSH2_VERSION
11+
./configure --prefix=$PREFIX --disable-static
12+
make
13+
make install
14+
cd ..
15+
16+
wget https://github.com/libgit2/libgit2/releases/download/v$LIBGIT2_VERSION/libgit2-$LIBGIT2_VERSION.tar.gz
17+
tar xf libgit2-$LIBGIT2_VERSION.tar.gz
18+
cd libgit2-$LIBGIT2_VERSION
19+
CMAKE_PREFIX_PATH=$PREFIX cmake . -DBUILD_CLAR=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX
20+
cmake --build . --target install
21+
cd ..

0 commit comments

Comments
 (0)