-
Notifications
You must be signed in to change notification settings - Fork 2
137 lines (135 loc) · 4.61 KB
/
test.yaml
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
# Copyright (C) 2012-2017 Brazil
# Copyright (C) 2023 Sutou Kouhei <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
name: Test
on:
push:
pull_request:
schedule:
- cron: |
0 0 * * *
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
ubuntu:
if: >-
github.event_name != 'schedule' ||
(github.event_name == 'schedule' &&
github.repository_owner == 'groonga')
name: Ubuntu + Groonga (${{ matrix.groonga-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
groonga-version:
- "latest"
- "main"
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt -y -V install software-properties-common
sudo add-apt-repository -y --enable-source
sudo apt -y -V install \
ccache
apt source nginx
ln -fs nginx-* nginx
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ubuntu-${{ matrix.groonga-version }}-ccache-${{ hashFiles('*.c') }}
restore-keys: ubuntu-${{ matrix.groonga-version }}-ccache-
- uses: actions/checkout@v4
if:
matrix.groonga-version == 'main'
with:
repository: groonga/groonga
path: groonga
submodules: recursive
- name: Install Groonga
run: |
if [ ${{ matrix.groonga-version }} = "latest" ]; then
sudo add-apt-repository -y ppa:groonga/ppa
sudo apt update
sudo apt -y -V install libgroonga-dev
else
sudo apt -y install \
cmake \
libmecab-dev \
libmsgpack-dev \
libxxhash-dev \
mecab-naist-jdic \
ninja-build
cmake \
-S groonga \
-B groonga.build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=/tmp/local \
-DCMAKE_BUILD_TYPE=Debug
ninja -C groonga.build install
echo "PKG_CONFIG_PATH=/tmp/local/lib/pkgconfig" >> $GITHUB_ENV
fi
- name: Build
run: |
cd nginx
./configure \
--add-dynamic-module=.. \
--prefix=/tmp/local
make -j$(nproc)
make install
- name: Enable Apache Arrow repository
if:
matrix.groonga-version == 'main'
run: |
sudo apt update -o="APT::Acquire::Retries=3"
sudo apt install -y -V -o="APT::Acquire::Retries=3" \
lsb-release \
wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt update -o="APT::Acquire::Retries=3"
- name: Install test dependencies
if:
matrix.groonga-version == 'main'
run: |
sudo env MAKEFLAGS=-j$(nproc) gem install \
grntest \
pkg-config \
red-arrow
- name: Set environment variables
if:
matrix.groonga-version == 'main'
run: |
echo "LD_LIBRARY_PATH=/tmp/local/lib" >> ${GITHUB_ENV}
echo "TZ=Asia/Tokyo" >> ${GITHUB_ENV}
echo "/tmp/local/bin" >> ${GITHUB_PATH}
echo "/tmp/local/sbin" >> ${GITHUB_PATH}
- name: Test
if:
matrix.groonga-version == 'main'
run: |
cd groonga
grntest \
--base-dir=test/command \
--n-retries=3 \
--ngx-http-groonga-module-so=/tmp/local/modules/ngx_http_groonga_module.so \
--read-timeout=30 \
--reporter=mark \
--testee=groonga-nginx \
test/command/suite