-
-
Notifications
You must be signed in to change notification settings - Fork 137
89 lines (77 loc) · 2.51 KB
/
test.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
name: test
on: [push, pull_request]
jobs:
build:
name: Test
runs-on: ubuntu-22.04
env:
CGO_CFLAGS_ALLOW: -Xpreprocessor
VIPS_VERSION: 8.15.2
V: 6
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.22
- name: Check out code
uses: actions/checkout@v2
- name: Install linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
meson ninja-build \
libglib2.0-dev libexpat-dev librsvg2-dev libpng-dev \
libjpeg-turbo8-dev libimagequant-dev libfftw3-dev \
libpoppler-glib-dev libxml2-dev \
libopenslide-dev libcfitsio-dev liborc-0.4-dev libpango1.0-dev \
libtiff5-dev libgsf-1-dev giflib-tools libwebp-dev libheif-dev \
libopenjp2-7-dev libcgif-dev
- name: Cache libvips
uses: actions/cache@v3
with:
path: vips-${{ env.VIPS_VERSION }}
key: ${{ runner.os }}-vips-${{ env.V }}-${{ env.VIPS_VERSION }}
restore-keys: |
${{ runner.os }}-vips-${{ env.V }}-
- name: Build libvips from source
run: |
if [ ! -d "vips-${{ env.VIPS_VERSION }}" ]
then
wget https://github.com/libvips/libvips/releases/download/v${{ env.VIPS_VERSION }}/vips-${{ env.VIPS_VERSION }}.tar.xz
tar xf vips-${{ env.VIPS_VERSION }}.tar.xz
fi
cd vips-${{ env.VIPS_VERSION }}
meson setup _build \
--buildtype=release \
--strip \
--prefix=/usr/local \
--libdir=lib \
-Dgtk_doc=false \
-Dmagick=disabled \
-Dintrospection=disabled
ninja -C _build
sudo ninja -C _build install
sudo ldconfig
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: make get
- name: Test
run: make test
- name: Commit golden files
if: github.event_name != 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "test: update golden files"
file_pattern: "testdata/golden"
- name: Coveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov