Не подтверждена Коммит bc4e932f создал по автору Юрьев ЛЕОНИД ВАЛЕРЬЕВИЧ's avatar Юрьев ЛЕОНИД ВАЛЕРЬЕВИЧ 💬
Просмотр файлов

mdbx: add public-visible CI on Github.

владелец b361652d
name: ci-android
env:
CI: GITHUB
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on: [push]
jobs:
ci-job:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ndk: [r26d, r27c]
target: [arm64-v8a, "armeabi-v7a with NEON", x86_64]
build-type: [Debug, Release]
os: [ubuntu-latest]
exclude:
- ndk: r26d
build-type: Debug
steps:
- uses: actions/checkout@v4
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: ${{ matrix.ndk }}
add-to-path: true
- name: ci-step
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
CI_MAKE_TARGET: ""
shell: bash
run: |
. ci.sh "-DANDROID_ABI=${{ matrix.target }}|-DCMAKE_TOOLCHAIN_FILE:PATH=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake|-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}"
name: ci-mingw
env:
CI: GITHUB
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on: [push]
jobs:
ci-job:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build-type: [Debug, Release]
dll: [ON, OFF]
without_crt: [ON, OFF]
os: [windows-latest]
exclude:
- build-type: Debug
dll: OFF
- build-type: Release
without_crt: ON
steps:
- uses: actions/checkout@v4
# - name: Update mingw64
# run: choco upgrade mingw -y --no-progress
- name: ci-step
shell: bash
env:
CI_MAKE_TARGET: smoke
run: |
echo "initial-PATH=$PATH" && \
export "PATH=/c/mingw64/bin:/c/programdata/mingw64/mingw64/bin:$PATH" && \
export MDBX_BUILD_OPTIONS=$(if [ "${{ matrix.build-type }}" = 'Debug' ]; then echo '-DMDBX_FORCE_ASSERTIONS=1'; else echo '-DNDEBUG=1'; fi) && \
export MDBX_BUILD_CXX=$(if [ "${{ matrix.without_crt }}" = 'OFF' ]; then echo 'YES'; else echo 'NO'; fi) && \
. ci.sh "-G|MinGW Makefiles|-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}|-DMDBX_BUILD_SHARED_LIBRARY:BOOL=${{ matrix.dll }}|-DMDBX_WITHOUT_MSVC_CRT:BOOL=${{ matrix.without_crt }}"
name: ci-posix
env:
CI: GITHUB
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on: [push]
jobs:
ci-job:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, macos-26]
build-type: [Debug, Release]
# alloy: [ON, OFF]
cxx: [ON, OFF]
# exclude:
# - os: macos-14
# cxx: OFF
# alloy: ON
steps:
- uses: actions/checkout@v4
- name: ci-step
shell: bash
run: |
export CI_MAKE_TARGET=$(if [ "$(uname)" = 'Linux' ]; then echo 'check'; elif [ "${{ matrix.build-type }}" != 'Debug' ]; then echo 'test'; else echo 'smoke'; fi) && \
export MDBX_BUILD_OPTIONS=$(if [ "${{ matrix.build-type }}" = 'Debug' ]; then echo '-DMDBX_FORCE_ASSERTIONS=1'; else echo '-DNDEBUG=1'; fi) && \
export MDBX_BUILD_CXX=$(if [ "${{ matrix.cxx }}" = 'ON' ]; then echo 'YES'; else echo 'NO'; fi) && \
. ci.sh "-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}|-DMDBX_BUILD_CXX:BOOL=${{ matrix.cxx }}"
name: ci-wincxx
env:
CI: GITHUB
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on: [push]
jobs:
ci-job:
strategy:
fail-fast: false
matrix:
toolset: [v142, v143]
cxx: [11, 14, 17, 20]
target: [Win32, x64, ARM64]
build-type: [Debug, Release]
os: [windows-latest, windows-2022]
exclude:
- os: windows-latest
toolset: v142
- os: windows-latest
cxx: 11
- os: windows-2022
toolset: v143
- os: windows-2022
cxx: 20
# - target: x64
# build-type: Debug
- target: ARM64
toolset: v142
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: ci-step
env:
CI_MAKE_TARGET: ""
CXXSTD: "-std=gnu++${{ matrix.cxx }}"
shell: bash
run: |
. ci.sh "-A|${{ matrix.target }}|-T|${{ matrix.toolset }}|-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}|-DCMAKE_CXX_STANDARD=${{ matrix.cxx }}" \
"--config|${{ matrix.build-type }}" "--build-config|${{ matrix.build-type }}"
name: ci-windows
env:
CI: GITHUB
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on: [push]
jobs:
ci-job:
strategy:
fail-fast: false
matrix:
toolset: [v143]
dll: [ON, OFF]
without_crt: [ON, OFF]
target: [x64, Win32]
build-type: [Debug, Release]
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: ci-step
env:
CI_MAKE_TARGET: ""
shell: bash
run: |
. ci.sh "-A|${{ matrix.target }}|-T|${{ matrix.toolset }}|-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}|-DMDBX_BUILD_SHARED_LIBRARY:BOOL=${{ matrix.dll }}|-DMDBX_WITHOUT_MSVC_CRT:BOOL=${{ matrix.without_crt }}" \
"--config|${{ matrix.build-type }}" "--build-config|${{ matrix.build-type }}"
#!/usr/bin/env bash
function failure() {
echo "Oops, $* failed ;(" >&2
exit 2
}
export ci_script_recursion="$((++ci_script_recursion))"
if [ $ci_script_recursion -gt 3 ]; then
failure "WTF: ci_script_recursion = $ci_script_recursion ?"
fi
IFS='|' read -r -a config_args <<< "${1:-}"
IFS='|' read -r -a build_args <<< "${2:-}"
IFS='|' read -r -a test_args <<< "${3:-}"
set -euxo pipefail
function provide_toolchain {
set +ex
export CC="$((which ${CC:-cc} || which gcc || which clang || which true) 2>/dev/null)"
export CXX="$((which ${CXX:-c++} || which g++ || which clang++ || which true) 2>/dev/null)"
echo "CC: ${CC} => $($CC --version | head -1)"
echo "CXX: ${CXX} => $($CXX --version | head -1)"
CMAKE="$(which cmake 2>/dev/null)"
if [ -z "${CMAKE}" -o -z "$(which ninja 2>/dev/null)" ]; then
SUDO=$(which sudo 2>&-)
if [ -n "$(which apt 2>/dev/null)" ]; then
${SUDO} apt update && sudo apt install -y cmake ninja-build libgtest-dev
elif [ -n "$(which dnf 2>/dev/null)" ]; then
${SUDO} dnf install -y cmake ninja-build gtest-devel
elif [ -n "$(which yum 2>/dev/null)" ]; then
${SUDO} yum install -y cmake ninja-build gtest-devel
fi
CMAKE="$(which cmake 2>/dev/null) | echo false"
fi
CMAKE_VERSION=$(eval expr $("${CMAKE}" --version | sed -n 's/cmake version \([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)/\10000 + \200 + \3/p' || echo '00000'))
echo "CMAKE: ${CMAKE} => $(""${CMAKE}"" --version | head -1) ($CMAKE_VERSION)"
set -euxo pipefail
}
function default_test {
GTEST_SHUFFLE=1 GTEST_RUNTIME_LIMIT=99 MALLOC_CHECK_=7 MALLOC_PERTURB_=42 \
ctest --output-on-failure --parallel 3 --schedule-random --no-tests=error \
"${test_args[@]+"${test_args[@]}"}"
}
function default_build {
local cmake_use_ninja=""
if "${CMAKE}" --help | grep -iq ninja && [ -n "$(which ninja 2>/dev/null)" ] && echo " ${config_args[@]+"${config_args[@]}"}" | grep -qv -e ' -[GTA] '; then
echo "NINJA: $(which ninja 2>/dev/null) => $(ninja --version | head -1)"
cmake_use_ninja="-G Ninja"
fi
"${CMAKE}" ${cmake_use_ninja} "${config_args[@]+"${config_args[@]}"}" .. && "${CMAKE}" --build . --verbose "${build_args[@]+"${build_args[@]}"}"
}
function default_ci {
provide_toolchain
local skipped=true
local ok=true
if [ -e CMakeLists.txt -a $CMAKE_VERSION -ge 30002 ]; then
skipped=false
mkdir @ci-cmake-build && (cd @ci-cmake-build && default_build && default_test && echo "Done (cmake)") || ok=false
fi
if [ -n "$CC" -a -n "${CI_MAKE_TARGET=test}" ] && [ -e GNUmakefile -o -e Makefile -o -e makefile ]; then
skipped=false
make -j2 all && make ${CI_MAKE_TARGET} && echo "Done (make)" || ok=false
fi
if [ $skipped = "true" ]; then
echo "Skipped since CMAKE_VERSION ($CMAKE_VERSION) < 3.0.2 and no Makefile"
elif [ $ok != "true" ]; then
exit 1
fi
}
git clean -x -f -d || echo "ignore 'git clean' error"
git describe --tags || git show --oneline -s
if [ -z "${CI_ACTION:-}" ]; then
CI_ACTION=default_ci
fi
$CI_ACTION || failure $CI_ACTION
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать