forked from openslide/openslide
-
Notifications
You must be signed in to change notification settings - Fork 4
261 lines (253 loc) · 8.65 KB
/
Copy pathc.yaml
File metadata and controls
261 lines (253 loc) · 8.65 KB
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
name: C
on:
push:
branches: [main]
tags: ["*"]
pull_request:
branches: [main]
permissions:
contents: read
env:
PYTHONUNBUFFERED: 1
jobs:
tests:
name: Build
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
include:
- os: ubuntu-latest
container: registry.fedoraproject.org/fedora:latest
extra: extra checks
sanitize: sanitize
- os: ubuntu-latest
container: quay.io/centos/centos:stream8
- os: ubuntu-latest
container: quay.io/centos/centos:stream9
- os: ubuntu-latest
container: debian:stable
ignore-cloexec-leaks: ignore CLOEXEC leaks
- os: ubuntu-20.04
ignore-cloexec-leaks: ignore CLOEXEC leaks
- os: ubuntu-22.04
- os: macos-12
sanitize: sanitize
steps:
- name: Install dependencies
run: |
case "${{ matrix.os }}" in
macos-*)
# https://github.com/actions/setup-python/issues/577
# https://github.com/q3aiml/ledger/commit/f53b35ae
brew list -1 | grep python | while read formula; do
brew unlink $formula
brew link --overwrite $formula
done
brew update
brew install \
meson pkg-config \
zlib \
libpng \
jpeg-turbo \
libtiff \
openjpeg \
gdk-pixbuf \
libxml2 \
sqlite \
cairo \
glib \
xdelta \
doxygen
python3 -m pip install --upgrade pip
python3 -m pip install requests PyYAML
;;
ubuntu-*)
case "${{ matrix.container }}" in
*fedora*|*centos*)
pyver=3
. /etc/os-release
case "$VERSION_ID" in
8)
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled powertools
# https://bugzilla.redhat.com/show_bug.cgi?id=2124013
dnf copr enable -y bgilbert/el8-pixman-openslide
pyver=38
pydotver=3.8
python=python38
;;
9)
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
dnf install -y epel-release epel-next-release
;;
*)
extra="git-core clang llvm valgrind valgrind-devel"
extra="$extra dnf-plugins-core"
debuginfo=1
;;
esac
dnf install -y \
gcc git meson pkg-config \
$python python${pyver}-requests python${pyver}-pyyaml \
diffutils \
zlib-devel \
libpng-devel \
libjpeg-turbo-devel \
libtiff-devel \
openjpeg2-devel \
gdk-pixbuf2-modules gdk-pixbuf2-devel \
libxml2-devel \
sqlite-devel \
cairo-devel \
glib2-devel \
doxygen \
xdelta libjpeg-turbo-utils $extra
if [ -n "$debuginfo" ]; then
dnf debuginfo-install -y cairo fontconfig glib2
fi
if [ -n "$pydotver" ]; then
alternatives --set python3 "/usr/bin/python${pydotver}"
fi
;;
*debian*|"")
if [ -n "${{ matrix.container }}" ]; then
# Debian container
jpeg=libjpeg-dev
else
# Ubuntu, on host
jpeg=libjpeg-turbo8-dev
sudo=sudo
fi
$sudo apt-get update
$sudo apt-get -y install \
gcc git meson pkg-config \
python3-requests python3-yaml \
zlib1g-dev \
libpng-dev \
$jpeg \
libtiff-dev \
libopenjp2-7-dev \
libgdk-pixbuf2.0-dev \
libxml2-dev \
libsqlite3-dev \
libcairo2-dev \
libglib2.0-dev \
doxygen \
xdelta3 libjpeg-turbo-progs
;;
esac
esac
- name: Check out repo
uses: actions/checkout@v3
- name: Check for uninitialized g_auto variables
if: matrix.extra
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
if git grep -En 'g_auto\(|g_autoptr\(|g_autofree ' | grep -v = ; then
echo "Found g_auto* declarations without initializers"
exit 1
fi
- name: Build
run: |
args=
if [ -n "${{ matrix.ignore-cloexec-leaks }}" ]; then
# Some distro versions have leaky libraries
echo "Disabling CLOEXEC leak check"
args="-D_nonatomic_cloexec=true"
fi
if ! meson setup builddir --werror $args; then
cat builddir/meson-logs/meson-log.txt
exit 1
fi
ninja -C builddir
- name: Check
run: |
trap "cat builddir/meson-logs/testlog.txt" EXIT
meson test -C builddir
- name: Docs
if: matrix.extra
run: |
cd builddir
ninja doc/html
docroot=openslide-docs-$GITHUB_RUN_NUMBER-$(echo $GITHUB_SHA | cut -c-10)
mkdir doc-artifact
mv doc/html doc-artifact/${docroot}
echo "docroot=${docroot}" >> $GITHUB_ENV
- name: Archive docs
if: matrix.extra
uses: actions/upload-artifact@v3
with:
name: ${{ env.docroot }}
path: builddir/doc-artifact
- name: Cache pristine slides
uses: actions/cache@v3
with:
key: pristine
path: builddir/test/_slidedata/pristine
- name: Check for overlarge tests
if: matrix.extra
run: |
# We don't want to allow arbitrarily large binary diffs into the
# repo, where they'll live in the Git history forever. At the time
# of writing, our largest xdelta diff is 4881 bytes. Arbitrarily
# set the cutoff at 6000.
# https://openslide.org/docs/testsuite/#tips
THRESHOLD=6000
large=$(find test/cases -type f -size +${THRESHOLD}c)
if [ -n "$large" ]; then
echo "Found test case files larger than $THRESHOLD bytes:"
echo "$large"
exit 1
fi
# Can't cache frozen tests because cache doesn't handle sparse files
- name: Unpack tests
run: |
cd builddir/test
./driver unfreeze
./driver unpack nonfrozen
- name: Test
run: cd builddir/test && ./driver run
- name: Sanitize
if: matrix.sanitize
run: cd builddir/test && ./driver sanitize
- name: Valgrind
# Valgrind tests are expensive, and maintaining suppressions across
# multiple distros can be fiddly. We might catch some additional bugs
# if we enabled this everywhere (mainly when there are different code
# paths for different dependency versions) but it doesn't seem worth it.
if: matrix.extra
run: cd builddir/test && ./driver valgrind
- name: Check exports
if: matrix.extra
run: cd builddir/test && ./driver exports
windows_setup:
name: Set up Windows build
runs-on: ubuntu-latest
outputs:
pkgver: ${{ steps.params.outputs.pkgver }}
steps:
- name: Calculate parameters
id: params
run: |
case "${{ github.event_name }}" in
pull_request)
echo "pkgver=pr-${{ github.event.number }}.${{ github.run_number }}.${{ github.run_attempt }}-$(echo ${{ github.sha }} | cut -c-7)" >> $GITHUB_OUTPUT
;;
push)
echo "pkgver=${GITHUB_REF#refs/heads/}-$(echo ${{ github.sha }} | cut -c-7)" >> $GITHUB_OUTPUT
;;
*)
echo "Unknown event type ${{ github.event_name }}"
exit 1
esac
windows_build:
name: Windows build
needs: windows_setup
uses: openslide/openslide-winbuild/.github/workflows/windows.yml@main
with:
openslide_repo: ${{ github.repository }}
openslide_ref: ${{ github.ref }}
pkgver: ${{ needs.windows_setup.outputs.pkgver }}
werror: true