Skip to content

Enable ci

Enable ci #1

Workflow file for this run

name: CMake
on:
push:
branches:
- master
- 'maintenance/**'
- ci-leak-check
tags:
- '*'
paths:
- '**/*.cmake'
- '**/*.cmake.in'
- '**/CMakeLists.txt'
- '.github/workflows/cmake.yml'
- '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/**'
pull_request:
paths:
- '**/*.cmake'
- '**/*.cmake.in'
- '**/CMakeLists.txt'
- '.github/workflows/cmake.yml'
- '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/**'
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: 75
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
GRN_WITH_MRUBY: ${{ matrix.mruby }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare ccache
run: |
echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV}
- name: Cache ccache
uses: actions/cache@v3
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 \
libevent-dev \
libluajit-5.1-dev \
liblz4-dev \
libmecab-dev \
libmsgpack-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_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@v3
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_SELECT_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: 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
# macos:
# name: macOS
# runs-on: macos-latest
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: Install packages
# run: |
# rm -f /usr/local/bin/2to3* || :
# rm -f /usr/local/bin/idle3* || :
# rm -f /usr/local/bin/pydoc3* || :
# rm -f /usr/local/bin/python3* || :
# rm -f /usr/local/bin/python3-config* || :
# brew update || :
# brew bundle
# - name: Prepare ccache
# run: |
# echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV}
# - name: Cache ccache
# uses: actions/cache@v3
# 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_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 \
# red-arrow \
# rroonga
# - name: Set environment variables
# run: |
# echo "COLUMNS=79" >> ${GITHUB_ENV}
# echo "TZ=Asia/Tokyo" >> ${GITHUB_ENV}
# - name: "Test: command line"
# run: |
# test/command_line/run-test.rb --groonga-install-prefix=/usr/local
# - name: "Test: mruby"
# 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: HTTP: load: Apache Arrow"
# run: |
# 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: MINGW32
# package-prefix: mingw-w64-i686
# - msystem: UCRT64
# package-prefix: mingw-w64-ucrt-x86_64
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
# - uses: actions/checkout@v3
# 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
# 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@v3
# 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@v3
# 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: Remove tests not for 32bit environment
# if: |
# matrix.msystem == 'MINGW32'
# shell: msys2 {0}
# run: |
# rm test/command/suite/ruby/eval/convert/string_to_time/over_int32.test
# rm test/command/suite/select/filter/geo_in_circle/no_index/north_east.test
# rm test/command/suite/tokenizers/document_vector_tf_idf/alphabet.test
# rm test/command/suite/tokenizers/document_vector_tf_idf/reindex.test
# rm test/command/suite/tokenizers/document_vector_tf_idf/token_column.test
# rm test/command/suite/tokenizers/document_vector_tf_idf/token_column_different_lexicon.test
# rm test/command/suite/tokenizers/document_vector_bm25/alphabet.test
# rm test/command/suite/tokenizers/document_vector_bm25/normalize_false.test
# rm test/command/suite/tokenizers/document_vector_bm25/reindex.test
# - 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@v3
# with:
# submodules: recursive
# - 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"
# - 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: Download bundled packages
# run: |
# cd vendor
# ruby download_groonga_normalizer_mysql.rb
# ruby download_lz4.rb
# ruby download_mecab.rb
# ruby download_message_pack.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@v3
# 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 vendor\apache-arrow-source\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=Release
# 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
# cmake --build ..\apache-arrow-build
# cmake --install ..\apache-arrow-build
# 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_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
# cmake %CMAKE_ARGS%
# type ..\groonga-build\CMakeFiles\CMakeError.log
# cmake --build ..\groonga-build
# cmake --install ..\groonga-build
# 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@v3
# 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_VCRUNTIME = "${VC_REDIST_DIR}\vcruntime140.dll"
# $VC_REDIST_VCRUNTIME_1 = "${VC_REDIST_DIR}\vcruntime140_1.dll"
# $VC_REDIST_MSVCP = "${VC_REDIST_DIR}\msvcp140.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 `
# "${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@v3
# 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
# - 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
# gem install `
# grntest `
# pkg-config `
# red-arrow
# - name: Install Red Arrow
# run: |
# - name: "Test: command line"
# run: |
# ruby test\command_line\run-test.rb `
# --groonga-install-prefix="${Env:FULL_INSTALL_FOLDER}"
# - 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}\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
#