forked from jwilk/didjvu
-
Notifications
You must be signed in to change notification settings - Fork 2
188 lines (185 loc) · 5.92 KB
/
ci.yml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: CI
on:
- push
- pull_request
env:
# Allow automated checks.
BOOST_VERSION: 1.87.0
BOOST_URL: https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz
jobs:
main:
strategy:
matrix:
include:
- python: '3.9'
gamera: pypi
- python: '3.10'
gamera: pypi
- python: '3.9'
gamera: master
- python: '3.10'
gamera: master
- python: '3.11'
gamera: master
- python: '3.12'
gamera: master
- python: '3.13'
gamera: master
runs-on: ubuntu-latest
name: Python ${{ matrix.python }} with Gamera ${{ matrix.gamera }}
steps:
- uses: actions/checkout@v4
- name: set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: apt update
run:
sudo apt-get update
- name: apt install deps
run:
sudo apt-get install
djvulibre-bin
docbook-xml
docbook-xsl
exiv2
gir1.2-gexiv2-0.10
libexempi[38]
libpng-dev
libtiff-dev
libxml2-utils
minidjvu
xsltproc
- name: set up CC and CXX env variables
run: |
echo "cc=gcc" >> $GITHUB_ENV
echo "cxx=g++" >> $GITHUB_ENV
- name: apt install GCC
run:
sudo apt-get install ${{ env.cc }} ${{ env.cxx }}
- name: install ccache
run: |
sudo apt-get install ccache
echo "/usr/lib/ccache:$PATH" >> $GITHUB_PATH
- name: check ccache setup
run: |
command -v ${{ env.cc }} | grep /ccache/
command -v ${{ env.cxx }} | grep /ccache/
- name: update PIP
run:
python -m pip install --upgrade pip
- name: install wheel
run:
python -m pip install --upgrade wheel
- name: download Gamera from GitHub
run: |
url="https://github.com/hsnr-gamera/gamera-4/archive/${{ matrix.gamera }}.tar.gz"
mkdir -p deps/
wget "$url" -O deps/gamera-${{ matrix.gamera }}.tar.gz
if: ${{ matrix.gamera == 'master' }}
- name: unpack Gamera from GitHub
run: |
cd deps/
tar -xzf gamera-*.tar.gz
if: ${{ matrix.gamera == 'master' }}
- name: build and install Gamera from unpacked archive
run: |
cd deps/gamera-*/
python -m pip install --verbose .
env:
CC: ${{ env.cc }}
CXX: ${{ env.cxx }}
if: ${{ matrix.gamera == 'master' }}
- name: remove Gamera source
run:
rm -rf deps
if: ${{ matrix.gamera == 'master' }}
- name: install package
run: |
python -m pip install .[dev,docs]
env:
CC: ${{ env.cc }}
CXX: ${{ env.cxx }}
# Package breaks for Python 3.12
# Corresponding issue: https://github.com/python-xmp-toolkit/python-xmp-toolkit/issues/90
- name: install python-xml-toolkit
run:
python -m pip install python-xmp-toolkit
if: ${{ matrix.python != '3.12' && matrix.python != '3.13' }}
- name: install python-xml-toolkit
run: |
mkdir -p deps/
cd deps/
wget https://github.com/python-xmp-toolkit/python-xmp-toolkit/archive/refs/heads/master.tar.gz
mkdir -p python-xmp-toolkit/
tar -xvzf master.tar.gz --strip-components=1 -C python-xmp-toolkit
cd python-xmp-toolkit
pip install .
if: ${{ matrix.python == '3.12' || matrix.python == '3.13' }}
# `libboost-python-dev` cannot be used, as this only works with the Python version shipped by the system.
# This means that for Ubuntu 20.04 each Python version different from 3.8 fails with something like
# `cannot find -lboost_python39` when installing Boost.Python through the system package manager.
# Based upon:
# * https://www.boost.org/doc/libs/release/libs/python/doc/html/building/installing_boost_python_on_your_.html
# * https://www.boost.org/doc/libs/release/more/getting_started/unix-variants.html
- name: install Boost.Python
run: |
mkdir -p deps
wget $BOOST_URL -O deps/boost.tar.gz
cd deps
tar -xzf boost.tar.gz
cd boost_*/
./bootstrap.sh --with-libraries=python
sudo ./b2 install
rm -rf deps
# The following two steps ensure that `libboost_python*.so.*` actually is available.
# Otherwise, the shared object would not be found during the tests (although the
# *py3exiv2* build actually finds them beforehand). For this reason, just add
# the installation path to the search path for Python.
# The alternative would be to use `--prefix` during bootstrapping above with the
# original value of `LD_LIBRARY_PATH`.
# Reference: https://github.com/boostorg/boost/blob/master/bootstrap.sh
- name: check Boost.Python
run:
ls -l /usr/local/lib/libboost*
- name: update LD_LIBRARY_PATH
run:
echo "LD_LIBRARY_PATH=/usr/local/lib:$( echo $LD_LIBRARY_PATH )" >> $GITHUB_ENV
- name: install py3exiv2
run: |
sudo apt-get install libexiv2-dev
python -m pip install py3exiv2
- name: set up PyGI
run: |
sudo apt-get install libgirepository1.0-dev
python -m pip install pygobject
- name: run tests
run:
make test
- name: determine coverage
run:
make update-coverage
- name: run flake8
run:
python -m flake8 .
- name: check docs
run:
make -C doc check
- name: build docs
run:
make -C doc all
- name: check whether the executable was installed correctly
run: |
cd /
didjvu --version
didjvu --help
- name: install man page
run:
make install_manpage PREFIX=$HOME/.local
- name: check whether the man page was installed correctly
env:
MANPATH: /home/runner/.local/share/man
MANWIDTH: 80
run: |
cd /
man 1 didjvu | grep -A 10 -w DIDJVU