@@ -2,10 +2,7 @@ name: test
22on : [push]
33
44env :
5- LIBZIM_VERSION : 8.1.0
6- LIBZIM_INCLUDE_PATH : include/zim
7- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
8- PROFILE : 1
5+ LIBZIM_DL_VERSION : " 8.2.0"
96
107jobs :
118 lint :
1613 - name : Set up Python ${{ matrix.python }}
17141815 with :
19- python-version : " 3.10 "
16+ python-version : " 3.11 "
2017 architecture : x64
2118
2219 - name : Check formatting and linting
2926 runs-on : ${{ matrix.os }}
3027 strategy :
3128 matrix :
32- os : [ubuntu-20 .04, macos-12]
33- python : ["3.6.15", "3. 7", "3.8", "3.9", "3.10", "3.11"]
29+ os : [ubuntu-22 .04, macos-12]
30+ python : ["3.7", "3.8", "3.9", "3.10", "3.11"]
3431
3532 steps :
3633@@ -41,60 +38,21 @@ jobs:
4138 python-version : ${{ matrix.python }}
4239 architecture : x64
4340
44- - name : set macOS environ
45- if : matrix.os == 'macos-12'
46- run : |
47- echo LIBZIM_EXT=dylib >> $GITHUB_ENV
48- echo LIBZIM_RELEASE=libzim_macos-x86_64-$LIBZIM_VERSION >> $GITHUB_ENV
49- echo LIBZIM_LIBRARY_PATH=lib/libzim.8.dylib >> $GITHUB_ENV
50-
51- - name : set linux environ
52- if : matrix.os == 'ubuntu-20.04'
53- run : |
54- echo LIBZIM_EXT=so >> $GITHUB_ENV
55- echo LIBZIM_RELEASE=libzim_linux-x86_64-$LIBZIM_VERSION >> $GITHUB_ENV
56- echo LIBZIM_LIBRARY_PATH=lib/x86_64-linux-gnu/libzim.so.$LIBZIM_VERSION >> $GITHUB_ENV
57-
58- - name : Cache libzim dylib & headers
59- 60- id : cache-libzim
61- with :
62- path : libzim_dist
63- key : ${{ env.LIBZIM_RELEASE }}-libzim-cache
64-
65- - name : Download libzim dylib & headers from OpenZIM.org releases
66- if : steps.cache-libzim.outputs.cache-hit != 'true'
67- run : |
68- wget -q https://download.openzim.org/release/libzim/$LIBZIM_RELEASE.tar.gz
69- tar --extract --file=$LIBZIM_RELEASE.tar.gz
70- mv $LIBZIM_RELEASE libzim_dist
41+ - name : Installing dependencies
42+ run : pip install -U pip setuptools build
7143
72- - name : Link libzim dylib & headers into workspace lib and include folders
73- run : |
74- cp -p $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_LIBRARY_PATH lib/libzim.$LIBZIM_EXT
75- cp -p $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_LIBRARY_PATH lib/
76- ln -s $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_INCLUDE_PATH include/zim
77- export LD_LIBRARY_PATH="$PWD/lib:$LD_LIBRARY_PATH"
78-
79- - name : update Linux shared objects cache
80- if : matrix.os == 'ubuntu-20.04'
81- run : |
82- sudo ldconfig $PWD/lib
44+ - name : Building & installing for tests (with profiling)
45+ env :
46+ PROFILE : 1
47+ run : pip install -e .
8348
84- - name : Build cython, sdist, and bdist_wheel
49+ - name : Testing
8550 run : |
86- pip install --upgrade pip install "cython>=0.29.32,<3.0" setuptools pip wheel
87- python3 setup.py build_ext --inplace
88- python3 setup.py sdist bdist_wheel
89-
90- - name : Test built package with pytest
91- run : |
92- pip install pytest pytest-cov
93- pip install -e .
94- export DYLD_LIBRARY_PATH="$PWD:$PWD/lib:$DYLD_LIBRARY_PATH"
95- pytest --cov=libzim --cov-report=term --cov-report term-missing .
51+ pip install pytest pytest-cov cython
52+ py.test --cov=libzim --cov-report=term --cov-report term-missing .
9653
9754 - name : Upload coverage report to codecov
98- run : |
99- pip install codecov
100- codecov
55+ if : matrix.os == 'ubuntu-22.04' && matrix.python == '3.11'
56+ uses : codecov/codecov-action@v3
57+ with :
58+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments