-
Notifications
You must be signed in to change notification settings - Fork 8
157 lines (156 loc) · 4.36 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
name: CI
on:
- push
- pull_request
jobs:
main:
strategy:
matrix:
include:
- gamera: gamera-3.4.3
pillow: pillow-3.4.2
os: ubuntu-20.04
- gamera: gamera-3.4.4
os: ubuntu-20.04
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: set up APT
run: |
printf '\n\nPackage: *\nPin: release o=Ubuntu\nPin-Priority: 9999\n' | sudo tee -a /etc/apt/preferences
printf 'Apt::Install-Recommends "false";\n' | sudo tee -a /etc/apt/apt.conf
sudo apt-get update
- name: set up Python 2.7
run: |
sudo apt-get install -f python-is-python2 python2-dev
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python get-pip.py
rm get-pip.py
- name: apt install deps
run:
sudo apt-get install -y
djvulibre-bin
docbook-xml
docbook-xsl
exiv2
gir1.2-gexiv2-0.10
libexempi[38]
libpng-dev
libtiff-dev
libxml2-utils
minidjvu
python-gi
xsltproc
- name: set up CC and CXX env variables
run: |
echo "cc=${CC}" >> $GITHUB_ENV
echo "cxx=${CC/cc/++}" >> $GITHUB_ENV
env:
CC: ${{matrix.cc || 'gcc'}}
- name: apt install GCC
run:
sudo apt-get install -y ${{env.cc}} ${{env.cxx}}
if: ${{matrix.cc}}
- name: install ccache
run: |
sudo apt-get install -y 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: restore ccache data
uses: actions/cache@v4
with:
path: ~/.ccache
key:
ccache-${{matrix.os}}-${{env.cc}}-${{matrix.gamera}}-${{matrix.pyexiv2}}
restore-keys:
ccache-${{matrix.os}}-${{env.cc}}-${{matrix.gamera}}-
- name: download Gamera
run: |
gamera=${{matrix.gamera}}
revision=${gamera#gamera-}
url="https://github.com/hsnr-gamera/gamera/archive/${revision}.tar.gz"
mkdir -p deps/
wget "$url" -O deps/${{matrix.gamera}}.tar.gz
- name: unpack Gamera
run: |
cd deps/
tar -xvzf gamera-*.tar.gz
- name: patch Gamera
run: |
cd deps/gamera-*/
echo '__version__ = "0.0"' > wx.py
sed -i -e 's/ int(gccv\[0\]) >= 4 and int(gccv\[1\]) >= 3:/ True:/' setup.py
- name: build Gamera
run: |
cd deps/gamera-*/
python setup.py build
env:
CC: ${{env.cc}}
CXX: ${{env.cxx}}
- name: install Gamera
run: |
cd deps/gamera-*/
python setup.py install --user
- name: remove Gamera source
run:
rm -rf deps
- name: install Pillow
run: |
pillow=${{matrix.pillow || 'pillow'}}
python -m pip install ${pillow/-/==}
- name: install python-xml-toolkit
run:
python -m pip install python-xmp-toolkit
- name: install pyexiv2
run: |
sudo apt-get install -y libboost-python-dev libexiv2-dev
python -m pip install --verbose git+https://github.com/escaped/pyexiv2
if: ${{matrix.pyexiv2}}
- name: install nose
run:
python -m pip install nose
- name: run tests
run:
make test
- name: run pydiatra
run: |
python -m pip install pydiatra
python -m pydiatra --verbose .
- name: run pyflakes
run: |
python -m pip install pyflakes
python -m pyflakes .
- name: check docs
run: |
python -m pip install docutils pygments
make -C doc check
- name: build docs
run:
make -C doc all
- name: install
run:
make install PREFIX=$HOME/.local
- name: check whether the executable was installed correctly
run: |
cd /
didjvu --version
didjvu --help
- name: run post-install tests
run: |
rm didjvu
make test-installed
git restore didjvu
- name: APT install man-db
run: |
sudo apt-get install -y man-db
- 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
# vim:ts=2 sts=2 sw=2 et