forked from groonga/groonga
-
Notifications
You must be signed in to change notification settings - Fork 0
863 lines (846 loc) · 29.4 KB
/
cmake.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
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
name: CMake
on:
push:
branches:
- main
- 'maintenance/**'
tags:
- '*'
paths:
- '**/*.cmake'
- '**/*.cmake.in'
- '**/CMakeLists.txt'
- '.github/workflows/cmake.yml'
- 'Brewfile'
- 'ci/**'
- 'cmake/**'
- 'include/**/*.h'
- 'include/**/*.h.in'
- 'include/**/*.hpp'
- 'lib/**/*.c'
- 'lib/**/*.cpp'
- 'lib/**/*.h'
- 'lib/**/*.hpp'
- 'lib/**/*.rb'
- 'plugins/**/*.c'
- 'plugins/**/*.cpp'
- 'plugins/**/*.h'
- 'plugins/**/*.rb'
- 'src/**/*.c'
- 'src/**/*.h'
- 'test/command/**'
- 'test/command_line/**'
- 'test/mruby/**'
- 'vendor/mruby/**'
pull_request:
paths:
- '**/*.cmake'
- '**/*.cmake.in'
- '**/CMakeLists.txt'
- '.github/workflows/cmake.yml'
- 'Brewfile'
- 'ci/**'
- 'cmake/**'
- 'include/**/*.h'
- 'include/**/*.h.in'
- 'include/**/*.hpp'
- 'lib/**/*.c'
- 'lib/**/*.cpp'
- 'lib/**/*.h'
- 'lib/**/*.rb'
- 'lib/**/*.rb'
- 'plugins/**/*.c'
- 'plugins/**/*.cpp'
- 'plugins/**/*.h'
- 'plugins/**/*.rb'
- 'src/**/*.c'
- 'src/**/*.h'
- 'test/command/**'
- 'test/command_line/**'
- 'test/mruby/**'
- 'vendor/mruby/**'
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
linux:
name: Linux
strategy:
fail-fast: false
matrix:
include:
- cc: gcc
cxx: g++
- cc: gcc
cxx: g++
mruby: "OFF"
- cc: clang
cxx: clang++
runs-on: ubuntu-latest
timeout-minutes: 90
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
GRN_WITH_MRUBY: ${{ matrix.mruby }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare ccache
run: |
echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV}
- name: Cache ccache
uses: actions/cache@v4
with:
path: ccache
key: cmake-linux-${{ matrix.cc }}-ccache-${{ hashFiles('lib/**', 'src/**', 'plugins/**', 'include/**') }}
restore-keys: cmake-linux-${{ matrix.cc }}-ccache-
- name: Enable Apache Arrow repository
run: |
sudo apt update -o="APT::Acquire::Retries=3"
sudo apt install -y -V -o="APT::Acquire::Retries=3" \
lsb-release \
wget
# Always use RC version to detect Apache Arrow related
# problems as fast as possible. Released Apache Arrow is
# tested in package related jobs.
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')-rc/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 sed \
-i"" \
-e "s,^URIs: \\(.*\\)/,URIs: \\1-rc/,g" \
/etc/apt/sources.list.d/apache-arrow.sources
- name: Install packages
run: |
sudo apt update -o="APT::Acquire::Retries=3"
sudo apt install -y -V -o="APT::Acquire::Retries=3" \
ccache \
cmake \
gdb \
gettext \
libarrow-dev \
libedit-dev \
libevent-dev \
libluajit-5.1-dev \
liblz4-dev \
libmecab-dev \
libmsgpack-dev \
libsimdjson-dev \
libstemmer-dev \
libxxhash-dev \
libzstd-dev \
mecab-naist-jdic \
ninja-build \
rapidjson-dev \
ruby-dev \
zlib1g-dev
- name: CMake
run: |
ccache --show-stats --verbose --version || :
cmake \
-B ../groonga.build \
-S . \
-GNinja \
-DCMAKE_INSTALL_PREFIX=$PWD/install \
-DCMAKE_BUILD_TYPE=Debug \
-DGRN_ALLOW_WARNING=OFF \
-DGRN_WITH_APACHE_ARROW=ON \
-DGRN_WITH_BLOSC=auto \
-DGRN_WITH_MRUBY=${GRN_WITH_MRUBY:-ON}
- name: Build
run: |
ninja -C ../groonga.build
ccache --show-stats --verbose --version || :
- name: Install
run: |
ninja -C ../groonga.build install
- name: Set environment variables
run: |
echo "COLUMNS=79" >> ${GITHUB_ENV}
echo "LD_LIBRARY_PATH=$PWD/install/lib" >> ${GITHUB_ENV}
echo "PKG_CONFIG_PATH=$PWD/lib/pkgconfig" >> ${GITHUB_ENV}
echo "TZ=Asia/Tokyo" >> ${GITHUB_ENV}
if [ "${{ matrix.cc }}" == "gcc" -a \
"${{ matrix.mruby }}" == "" ]; then
echo "GRN_TEST_RUN_ALL=yes" >> ${GITHUB_ENV}
fi
if [ -e "install/bin/grndb" ] ; then
echo "GRN_TEST_RUN_COMMAND_LINE=yes" >> ${GITHUB_ENV}
fi
echo "$PWD/install/bin" >> ${GITHUB_PATH}
- name: Install test dependencies
run: |
sudo env MAKEFLAGS=-j$(nproc) gem install \
grntest \
pkg-config \
red-arrow \
rroonga
- uses: actions/cache@v4
with:
path: |
~/.cache/red-datasets
key: red-datasets-ubuntu
- name: "Test: command line"
if: env.GRN_TEST_RUN_COMMAND_LINE == 'yes'
run: |
test/command_line/run-test.rb --groonga-install-prefix=$PWD/install
- name: "Test: mruby"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
USE_SYSTEM=yes test/mruby/run-test.rb
- name: "Test: stdio"
run: |
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
test/command/suite
- name: "Test: stdio: optimize"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
export GRN_EXPR_OPTIMIZE=yes
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
test/command/suite
- name: "Test: stdio: NFKC121"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
test/command/suite/normalizers/nfkc/
env:
NFKC: "121"
- name: "Test: stdio: NFKC130"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
test/command/suite/normalizers/nfkc/
env:
NFKC: "130"
- name: "Test: stdio: NFKC150"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
test/command/suite/normalizers/nfkc/
env:
NFKC: "150"
- name: "Test: stdio: n_workers"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
export GRN_N_WORKERS_DEFAULT=-1
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
test/command/suite
- name: "Test: HTTP: load: Apache Arrow"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
--input-type=apache-arrow \
--interface=http \
test/command/suite
- name: "Test: HTTP: load: Apache Arrow: n_workers"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
export GRN_N_WORKERS_DEFAULT=-1
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
--input-type=apache-arrow \
--interface=http \
test/command/suite/load
- name: "Test: HTTP: command: POST"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
--input-type=apache-arrow \
--interface=http \
--use-http-post \
test/command/suite
- name: "Test: HTTP: command: chunked"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
grntest \
--base-dir test/command \
--n-retries=2 \
--timeout=10 \
--read-timeout=30 \
--reporter=mark \
--input-type=apache-arrow \
--interface=http \
--use-http-chunked \
test/command/suite
- name: "Test: HTTP: reference count"
if: env.GRN_TEST_RUN_ALL == 'yes'
run: |
export GRN_ENABLE_REFERENCE_COUNT=yes
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
--interface=http \
test/command/suite
docker:
name: Docker
strategy:
fail-fast: false
matrix:
target:
- "alpine-3.20"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Login to GitHub Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull
continue-on-error: true
run: |
docker compose pull ${{ matrix.target }}
- name: Build
run: |
docker compose build ${{ matrix.target }}
- name: Run
run: |
docker compose run ${{ matrix.target }}
- name: Push
if: github.ref_name == 'main'
continue-on-error: true
run: |
docker compose push ${{ matrix.target }}
macos:
name: macOS
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install packages
run: |
brew bundle
- name: Prepare ccache
run: |
echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV}
- name: Cache ccache
uses: actions/cache@v4
with:
path: ccache
key: cmake-macos-ccache-${{ hashFiles('lib/**', 'src/**', 'plugins/**', 'include/**') }}
restore-keys: cmake-macos-ccache-
- name: Run CMake
run: |
ccache --show-stats --verbose --version || :
export SDKROOT="$(xcrun --show-sdk-path)"
cmake \
-B ../groonga.build \
-S . \
-GNinja \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Debug \
-DGRN_ALLOW_WARNING=OFF \
-DGRN_WITH_APACHE_ARROW=ON \
-DGRN_WITH_BLOSC=auto \
-DGRN_WITH_MRUBY=ON \
-DRUBY=$(which ruby)
- name: Build
run: |
ninja -C ../groonga.build
ccache --show-stats --verbose --version || :
- name: Install
run: |
sudo ninja -C ../groonga.build install
- name: Install test dependencies
run: |
MAKEFLAGS=-j$(nproc) gem install \
grntest \
pkg-config \
rroonga
brew install apache-arrow-glib
MAKEFLAGS=-j$(nproc) gem install \
--version $(pkg-config --modversion arrow-glib) \
red-arrow
- name: Set environment variables
run: |
echo "COLUMNS=79" >> ${GITHUB_ENV}
echo "TZ=Asia/Tokyo" >> ${GITHUB_ENV}
- name: "Test: command line"
# TODO: I don't know why but this is too slow on macOS...
if: false
run: |
test/command_line/run-test.rb \
--groonga-install-prefix=/usr/local \
-v
- name: "Test: mruby"
# TODO: Disabled temporarily as a workaround for the rpath issue in Rroonga.
if: false
run: |
USE_SYSTEM=yes test/mruby/run-test.rb
- name: "Test: stdio"
run: |
DYLD_LIBRARY_PATH=/usr/local/lib \
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
test/command/suite
- name: "Test: HTTP: load: Apache Arrow"
run: |
DYLD_LIBRARY_PATH=/usr/local/lib \
grntest \
--base-dir test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
--input-type=apache-arrow \
--interface=http \
test/command/suite
windows-mingw:
name: Windows MinGW
runs-on: windows-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- msystem: MINGW64
package-prefix: mingw-w64-x86_64
- msystem: UCRT64
package-prefix: mingw-w64-ucrt-x86_64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/checkout@v4
with:
repository: msys2/MINGW-packages
path: ci/msys2/MINGW-packages
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
${{ matrix.package-prefix }}-ccache
${{ matrix.package-prefix }}-toolchain
${{ matrix.package-prefix }}-ruby
${{ matrix.package-prefix }}-xsimd
base-devel
binutils
git
msys2-devel
pactoys
- name: Prepare
shell: msys2 {0}
run: |
set -ex
cd ci/msys2
sed -i'' -e 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf
MINGW-packages/.ci/fetch-validpgpkeys.sh
- name: Prepare ccache
shell: msys2 {0}
run: |
echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV}
- name: Cache ccache
uses: actions/cache@v4
with:
path: ccache
key: cmake-windows-mingw-${{ matrix.msystem }}-ccache-${{ hashFiles('lib/**', 'src/**', 'plugins/**', 'include/**') }}
restore-keys: cmake-windows-mingw-${{ matrix.msystem }}-ccache-
- name: Build
shell: msys2 {0}
run: |
set -ex
version=$(cat base_version)
rake dist
mv groonga-${version}.tar.gz ci/msys2/
cd ci/msys2
sed -i'' -e "s/^pkgver=/pkgver=${version}/" PKGBUILD
MINGW_ARCH=${{ matrix.msystem }} \
makepkg-mingw \
--cleanbuild \
--nocheck \
--noconfirm \
--noprogressbar \
--rmdeps \
--syncdeps
ccache --show-stats --verbose --version || :
- name: Install
shell: msys2 {0}
run: |
set -ex
cd ci/msys2
pacman \
--noconfirm \
--noprogressbar \
--upgrade \
*.pkg.tar.*
cp -a *.pkg.tar.* ../../
# Artifact
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.msystem }}
path: "*.pkg.tar.*"
# Test
- name: Use JST
run: |
Set-TimeZone -Id "Tokyo Standard Time"
- name: Install test dependencies
shell: msys2 {0}
run: |
# "fiddle" is for ensuring using the installed system libffi
MAKEFLAGS=-j$(nproc) gem install \
fiddle \
grntest \
pkg-config \
red-arrow
ruby -e "require 'arrow'"
- name: Prepare setup-extpp.rb
shell: msys2 {0}
run: |
cat <<RUBY > setup-extpp.rb
["extpp"].each do |gem|
spec = Gem::Specification.find_by_name(gem)
ENV["PATH"] = [
File.join(spec.full_gem_path, "lib"),
ENV["PATH"],
].join(File::PATH_SEPARATOR)
end
RUBY
- name: "Test: command line"
shell: msys2 {0}
run: |
ruby test/command_line/run-test.rb
- name: "Test: stdio"
shell: msys2 {0}
run: |
ruby \
-r./setup-extpp \
-S \
grntest \
--base-directory=test/command \
--n-retries=2 \
--read-timeout=30 \
--reporter=mark \
--timeout=60 \
test/command/suite
windows-msvc:
name: Windows MSVC
strategy:
fail-fast: false
matrix:
include:
- runs-on: windows-2022
vc-toolset-version: 143
vs-version: 2022
- runs-on: windows-2019
vc-toolset-version: 142
vs-version: 2019
env:
VC_ARCHITECTURE: x64
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/checkout@v4
with:
path: apache-arrow
ref: apache-arrow-16.1.0
repository: apache/arrow
submodules: recursive
# Use CMake 3.27 not 3.26.
# Workaround: https://github.com/actions/runner-images/issues/8598
- name: Remove Strawberry Perl
run: |
Remove-Item C:\Strawberry -Force -Recurse
- name: Disable crash dialog
run: |
reg add "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
/v DontShowUI `
/t REG_DWORD `
/d 1 `
/f
- name: Use JST
run: |
Set-TimeZone -Id "Tokyo Standard Time"
- name: Download bundled packages
run: |
cd vendor
ruby download_groonga_normalizer_mysql.rb
ruby download_lz4.rb
ruby download_mecab.rb
ruby download_rapidjson.rb
ruby download_xxhash.rb
ruby download.rb
- name: Set environments
run: |
Write-Output "CMAKE_BUILD_PARALLEL_LEVEL=${Env:NUMBER_OF_PROCESSORS}" | `
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$GROONGA_VERSION = (Get-Content base_version)
if (!("${Env:GITHUB_REF}".StartsWith("refs/tags/"))) {
$GROONGA_VERSION += "-$(${Env:GITHUB_SHA}.Substring(0, 7))"
}
Write-Output "GROONGA_VERSION=${GROONGA_VERSION}" | `
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$INSTALL_FOLDER = "groonga-${GROONGA_VERSION}-${Env:VC_ARCHITECTURE}-vs${{ matrix.vs-version }}"
$INSTALL_FOLDER_WITH_VCRUNTIME = "${INSTALL_FOLDER}-with-vcruntime"
$INSTALL_PARENT_FOLDER = "install"
$INSTALL_PARENT_FOLDER_WITH_VCRUNTIME = `
"${INSTALL_PARENT_FOLDER}-with-vcruntime"
$RELATIVE_INSTALL_FOLDER = "${INSTALL_PARENT_FOLDER}\${INSTALL_FOLDER}"
$RELATIVE_INSTALL_FOLDER_WITH_VCRUNTIME = `
"${INSTALL_PARENT_FOLDER_WITH_VCRUNTIME}\${INSTALL_FOLDER_WITH_VCRUNTIME}"
$FULL_INSTALL_FOLDER = `
"${Env:GITHUB_WORKSPACE}\${RELATIVE_INSTALL_FOLDER}"
$FULL_INSTALL_FOLDER_WITH_VCRUNTIME = `
"${Env:GITHUB_WORKSPACE}\${RELATIVE_INSTALL_FOLDER_WITH_VCRUNTIME}"
Write-Output "INSTALL_FOLDER=${INSTALL_FOLDER}" | `
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "INSTALL_FOLDER_WITH_VCRUNTIME=${INSTALL_FOLDER_WITH_VCRUNTIME}" | `
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "FULL_INSTALL_FOLDER=${FULL_INSTALL_FOLDER}" | `
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "FULL_INSTALL_FOLDER_WITH_VCRUNTIME=${FULL_INSTALL_FOLDER_WITH_VCRUNTIME}" | `
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if (${{ matrix.vs-version }} -ge 2022) {
$VC_PREFIX = "C:\Program Files\Microsoft Visual Studio\${{ matrix.vs-version }}\Enterprise\VC"
}
else {
$VC_PREFIX = "C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs-version }}\Enterprise\VC"
}
Write-Output "VC_PREFIX=${VC_PREFIX}" | `
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "CCACHE_DIR=${{ github.workspace }}\ccache" | `
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache ccache
uses: actions/cache@v4
with:
path: ccache
key: cmake-windows-msvc-${{ matrix.vs-version }}-ccache-${{ hashFiles('lib/**', 'src/**', 'plugins/**', 'include/**') }}
restore-keys: cmake-windows-msvc-${{ matrix.vs-version }}-ccache-
- name: Prepare ccache
run: |
choco install ccache
Get-Command ccache
(Get-Command ccache).Source
ccache --show-stats --verbose --version
- name: Set version
run: |
"GRN_VERSION=${Env:GROONGA_VERSION}" | Set-Content version.sh
- name: Install Apache Arrow
shell: cmd
run: |
call "%VC_PREFIX%\Auxiliary\Build\vcvarsall.bat" %VC_ARCHITECTURE%
set CMAKE_ARGS=-S apache-arrow\cpp
set CMAKE_ARGS=%CMAKE_ARGS% -B ..\apache-arrow-build
set CMAKE_ARGS=%CMAKE_ARGS% -G Ninja
set CMAKE_ARGS=%CMAKE_ARGS% -DARROW_BUILD_STATIC=OFF
set CMAKE_ARGS=%CMAKE_ARGS% -DARROW_COMPUTE=ON
set CMAKE_ARGS=%CMAKE_ARGS% -DBoost_SOURCE=BUNDLED
set CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_BUILD_TYPE=RelWithDebInfo
set CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INSTALL_PREFIX=%FULL_INSTALL_FOLDER%
set CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_UNITY_BUILD=ON
cmake %CMAKE_ARGS% || (type ..\apache-arrow-build\CMakeFiles\CMakeError.log & exit /B)
cmake --build ..\apache-arrow-build || exit /B
cmake --install ..\apache-arrow-build || exit /B
ccache --show-stats --verbose --version
- name: Install Groonga
shell: cmd
run: |
call "%VC_PREFIX%\Auxiliary\Build\vcvarsall.bat" %VC_ARCHITECTURE%
set CMAKE_ARGS=-S .
set CMAKE_ARGS=%CMAKE_ARGS% -B ..\groonga-build
set CMAKE_ARGS=%CMAKE_ARGS% -G "Ninja"
set CMAKE_ARGS=%CMAKE_ARGS% "-DCMAKE_INSTALL_PREFIX=%FULL_INSTALL_FOLDER%"
set CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_BUILD_TYPE=RelWithDebInfo
set CMAKE_ARGS=%CMAKE_ARGS% -DGRN_ALLOW_WARNING=ON
set CMAKE_ARGS=%CMAKE_ARGS% -DGRN_WITH_APACHE_ARROW=ON
set CMAKE_ARGS=%CMAKE_ARGS% -DGRN_WITH_BLOSC=auto
set CMAKE_ARGS=%CMAKE_ARGS% -DGRN_WITH_MRUBY=ON
set CMAKE_ARGS=%CMAKE_ARGS% -DGRN_WITH_XXHASH=bundled
set CMAKE_ARGS=%CMAKE_ARGS% -DGRN_WITH_ZLIB=no
set CMAKE_ARGS=%CMAKE_ARGS% -DGRN_WITH_ZSTD=bundled
set CMAKE_ARGS=%CMAKE_ARGS% -DGROONGA_NORMALIZER_MYSQL_DOC_DIR=share/groonga-normalizer-mysql
cmake %CMAKE_ARGS% || (type ..\groonga-build\CMakeFiles\CMakeError.log & exit /B)
cmake --build ..\groonga-build || exit /B
cmake --install ..\groonga-build || exit /B
ccache --show-stats --verbose --version
- name: Install Groonga Admin
run: |
cd "${Env:FULL_INSTALL_FOLDER}\share\groonga\html"
Move-Item admin admin.old
Invoke-WebRequest `
-Uri "https://packages.groonga.org/source/groonga-admin/groonga-admin.tar.gz" `
-OutFile "groonga-admin.tar.gz"
tar xf groonga-admin.tar.gz
Remove-Item groonga-admin.tar.gz -Force
Move-Item groonga-admin-*\html admin
Remove-Item groonga-admin-*\source -Force -Recurse
Move-Item groonga-admin-* ..\groonga-admin
# Artifact
- name: Compress the artifact without VC++ runtime
run: |
pushd "${Env:FULL_INSTALL_FOLDER}\.."
Compress-Archive `
-Path ${Env:INSTALL_FOLDER} `
-DestinationPath "${Env:FULL_INSTALL_FOLDER}.zip"
popd
Copy-Item `
"${Env:FULL_INSTALL_FOLDER}.zip" `
"${Env:INSTALL_FOLDER}.zip"
- uses: actions/upload-artifact@v4
with:
name: ${{ env.INSTALL_FOLDER }}
path: ${{ env.INSTALL_FOLDER }}.zip
- name: Prepare artifacts with VC++ runtime
run: |
Set-PSDebug -Trace 2
New-Item `
-Path "${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\.." `
-ItemType Directory
Copy-Item -Recurse `
"${Env:FULL_INSTALL_FOLDER}" `
"${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}"
$GROONGA_VC_REDIST_LICENSE_DIR = `
"${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\share\groonga\vcruntime"
New-Item `
-Path "${GROONGA_VC_REDIST_LICENSE_DIR}" `
-ItemType Directory
$VC_REDIST_VERSION = (Get-Content "${Env:VC_PREFIX}\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt")
$VC_REDIST_DIR = "${Env:VC_PREFIX}\Redist\MSVC\${VC_REDIST_VERSION}\${Env:VC_ARCHITECTURE}\Microsoft.VC${{ matrix.vc-toolset-version }}.CRT"
$VC_REDIST_DIR_OPEN_MP = "${Env:VC_PREFIX}\Redist\MSVC\${VC_REDIST_VERSION}\${Env:VC_ARCHITECTURE}\Microsoft.VC${{ matrix.vc-toolset-version }}.OpenMP"
$VC_REDIST_VCRUNTIME = "${VC_REDIST_DIR}\vcruntime140.dll"
$VC_REDIST_VCRUNTIME_1 = "${VC_REDIST_DIR}\vcruntime140_1.dll"
$VC_REDIST_MSVCP = "${VC_REDIST_DIR}\msvcp140.dll"
$VC_REDIST_VCOMP = "${VC_REDIST_DIR_OPEN_MP}\vcomp140.dll"
Copy-Item `
${VC_REDIST_VCRUNTIME} `
"${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\bin"
if (Test-Path ${VC_REDIST_VCRUNTIME_1}) {
Copy-Item `
${VC_REDIST_VCRUNTIME_1} `
"${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\bin"
}
Copy-Item `
${VC_REDIST_MSVCP} `
"${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\bin"
Copy-Item `
${VC_REDIST_VCOMP} `
"${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\bin"
Copy-Item `
"${Env:GITHUB_WORKSPACE}\packages\windows\vcruntime\vs${{ matrix.vs-version }}\readme.txt" `
${GROONGA_VC_REDIST_LICENSE_DIR}
$UCRT_REDIST_DIR = "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\${Env:VC_ARCHITECTURE}"
Copy-Item `
"${UCRT_REDIST_DIR}\*.dll" `
"${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\bin"
Copy-Item `
"${Env:GITHUB_WORKSPACE}\packages\windows\vcruntime\ucrt-readme.txt" `
${GROONGA_VC_REDIST_LICENSE_DIR}
- name: Compress the artifact with VC++ runtime
run: |
pushd "${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\.."
Compress-Archive `
-Path ${Env:INSTALL_FOLDER_WITH_VCRUNTIME} `
-DestinationPath "${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}.zip"
popd
Copy-Item `
"${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}.zip" `
"${Env:INSTALL_FOLDER_WITH_VCRUNTIME}.zip"
- uses: actions/upload-artifact@v4
with:
name: ${{ env.INSTALL_FOLDER_WITH_VCRUNTIME }}
path: ${{ env.INSTALL_FOLDER_WITH_VCRUNTIME }}.zip
# Release
- name: Upload the artifacts to release
if: |
startsWith(github.ref, 'refs/tags/')
run: |
gh release upload ${Env:GITHUB_REF_NAME} `
"${Env:INSTALL_FOLDER}.zip" `
"${Env:INSTALL_FOLDER_WITH_VCRUNTIME}.zip"
env:
GH_TOKEN: ${{ github.token }}
# Test
- uses: ruby/setup-ruby@v1
with:
# We can't use "ruby" here because json-stream still uses
# Fixnum that is removed in recent Ruby. :<
#
# We can use "ruby" here when we remove json-stream
# dependency from groonga-command-parser.
ruby-version: "3.1"
- name: Update MSYS2
run: |
ridk exec pacman --sync --refresh --sysupgrade --sysupgrade --noconfirm
taskkill /F /FI "MODULES eq msys-2.0.dll"
ridk exec pacman --sync --refresh
- name: Update GCC
run: |
ridk exec pacman --sync --noconfirm mingw-w64-ucrt-x86_64-gcc
- name: Install test dependencies
run: |
$Env:MAKEFLAGS = "-j${Env:NUMBER_OF_PROCESSORS}"
ridk exec pacman `
--sync `
--noconfirm `
mingw-w64-ucrt-x86_64-arrow `
mingw-w64-ucrt-x86_64-xsimd
gem install `
grntest `
pkg-config `
red-arrow
- name: "Test: command line"
run: |
ruby test\command_line\run-test.rb `
--groonga-install-prefix="${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}"
- name: "Test: HTTP: reference count: Apache Arrow: chunked"
run: |
$Env:GRN_ENABLE_REFERENCE_COUNT = "yes"
grntest `
--base-directory test\command `
--groonga "${Env:FULL_INSTALL_FOLDER_WITH_VCRUNTIME}\bin\groonga.exe" `
--input-type apache-arrow `
--interface http `
--n-retries 2 `
--read-timeout=30 `
--reporter mark `
--timeout 360 `
--use-http-chunked `
test\command\suite