X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=.github%2Fworkflows%2Fcmake-build-ci.gen;h=40c4db2db1eb98d39e0bad24e4ce9eb36f78478f;hb=2902291b9589d17e55d2397959c8cff9772b38a3;hp=9dcbf069c44f1025fb1c8304824b30b732676b28;hpb=a78a7db2833925c753e1f59b1fd2428b81586dfb;p=m6w6%2Flibmemcached diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index 9dcbf069..40c4db2d 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -3,12 +3,13 @@ echo "# Generated file; do not edit!\n"; -const PRE = " "; const DEF = [ "os" => "Linux", "Linux" => "ubuntu-20.04", + "Windows" => "windows-2019", "macOS" => "macos-10.15", "ubuntu-20.04" => "gnu", + "windows-2019" => "msvc", "macos-10.15" => "clang", "gnu" => [ "ver" => "cur", @@ -16,17 +17,34 @@ const DEF = [ "CXX" => "g++", ], "clang" => [ - "ver" => "", + "ver" => "cur", "CC" => "clang", "CXX" => "clang++", ], + "msvc" => [ // dummy + "ver" => "cur", + "CC" => "msvc", + "CXX" => "msvc", + ], + "mingw" => [ // dummy + "ver" => "cur", + "CC" => "mingw", + "CXX" => "mingw", + ] ]; -const APT = [ +const ENV = [ "ubuntu-20.04" => [ "gnu" => [ "new" => [ - "CC" => "gcc-10", - "CXX" => "g++-10", + "INSTALL_CC" => "gcc-10", + "INSTALL_CXX" => "g++-10", + ] + ] + ], + "ubuntu-18.04" => [ + "clang" => [ + "old" => [ + "CXXFLAGS" => "-stdlib=libc++" ] ] ] @@ -68,15 +86,26 @@ const MAP = [ ] ] ] - ] + ], ] ]; /** * @var bool $splat_map false = no splat map, null = default splat map, true = full splat map */ -function steps($splat_map = null) { - if ($splat_map !== false) { +function steps_setenv($os_vnd, $splat_map = null) { + if ($os_vnd === "Windows") { +?> + - name: Prepare environment (Windows) + run: | + echo "c:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "c:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: Prepare environment (MinGW) + if: env.CC_VND == 'mingw' + run: | + echo "CMAKE_GENERATOR=\"MinGW Makefiles\"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + $os_vers) { foreach ($os_vers as $os_ver => $cc_vnds_) { if (!$splat_map && DEF[DEF["os"]] != $os_ver) continue; @@ -87,17 +116,18 @@ function steps($splat_map = null) { foreach ($cc_vers as $cc_ver => $ver) { if (!$splat_map && DEF[DEF[DEF[DEF["os"]]]]["ver"] != $cc_ver) continue; ?> - - name: Prepare environment () - if: () - run: echo CC= >> ${GITHUB_ENV} - run: echo CXX= >> ${GITHUB_ENV} + - name: Prepare environment () + if: () + run: | + echo CC="" >> ${GITHUB_ENV} + echo CXX="" >> ${GITHUB_ENV} $val) { ?> - run: echo INSTALL_CC='' >> ${GITHUB_ENV} - run: echo INSTALL_CXX='' >> ${GITHUB_ENV} + echo ="" >> ${GITHUB_ENV} - - name: Install dependencies - if: runner.os == 'Linux' - run: sudo apt-get install libevent-dev libsasl-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX} - - name: Generate build tree (${CMAKE_CONFIG_TYPE}) - run: mkdir build - run: cmake -S . -B build - - name: Build all with ${CXX} ${CXXFLAGS} - run: make -C build -j2 all - - name: Test - run: make -C build -j2 test - - name: Install - run: make -C build -j2 install DESTDIR=. - - name: Failed tests log - if: ${{ failure() }} - run: cat Testing/Temporary/LastTest.log + - name: Install dependencies () + if: runner.os == '' + + run: | + sudo apt-get install -my \ + libevent-dev \ + libsasl2-dev \ + libtbb-dev \ + python3-sphinx \ + ${INSTALL_MEMCACHED} \ + ${INSTALL_CC} ${INSTALL_CXX} + sudo systemctl stop memcached || true + + run: | + brew install bison flex sphinx-doc ${INSTALL_MEMCACHED} + brew services stop memcached || true + echo MEMCACHED_BINARY="/usr/local/bin/memcached" >> ${GITHUB_ENV} + + uses: msys2/setup-msys2@v2 + with: + release: false + path-type: inherit + install: >- + rsync + openssh + + - name: Build memcached + if: runner.os != 'Windows' + run: | + if test -d memcached + then + cd memcached + ./autogen.sh + ./configure CFLAGS="-O2 -pipe" \ + --prefix=${MEMCACHED_PREFIX} \ + --enable-sasl \ + --enable-sasl-pwdb \ + --disable-coverage \ + --disable-dependency-tracking \ + --disable-docs \ + --disable-extstore \ + --disable-option-checking \ + ; + make -j2 + make install + cd .. + echo MEMCACHED_BINARY="${MEMCACHED_PREFIX}/bin/memcached" >> ${GITHUB_ENV} + fi + + - name: Generate build tree (${{ env.CMAKE_BUILD_TYPE }}) + run: cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build + - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }} + run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 + + - name: Test + if: env.BUILD_TESTING == 'ON' + run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target test + - name: Install + if: env.BUILD_TESTING == 'ON' + run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /tmp + - name: Failed tests log + if: ${{ env.BUILD_TESTING == 'ON' && failure() }} + run: cat build/Testing/Temporary/LastTest.log || true + + - name: Package + env: + PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} + if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release' + run: | + cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build + cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package + cmake -DCPACK_COMPONENT_INSTALL=ON build + cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package + cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target push-artifacts + + - name: Notify Gitter (success) + run: bash .github/notify-gitter.sh ${{ secrets.GITTER }} ${{ success() }} + + OS_VND: # + OS_VER: # + CC_VND: # + CC_VER: # name: cmake-build-ci -on: +on: push: - paths-ignore: - - "docs/**" - branches-ignore: + paths: + - "contrib/**" + - "include/**" + - "src/**" + - "test/**" + - "CMake*" + - "CPack*" + - ".github/workflows/cmake-build-ci*" + branches-ignore: - gh-pages - - v1.x pull_request: - branches: + branches: - master - v1.x env: # defaults INSTALL_MEMCACHED: memcached - CMAKE_CONFIG_TYPE: Debug - BUILD_TESTING: "ON" - ENABLE_SASL: "ON" + ENABLE_SASL: "OFF" # ^ almost no memcached distribution package has built in sasl support ENABLE_HASH_HSIEH: "ON" - ENABLE_DTRACE: "ON" - VERBOSE: "ON" + ENABLE_DTRACE: "OFF" OS_VND: # OS_VER: # CC_VND: # CC_VER: # jobs: - # release builds - ci-rel: - strategy: - matrix: - os: [ubuntu-20.04, ubuntu-18.04] - compiler_vendor: [gnu, clang] - compiler_version: [new, cur, old] - runs-on: ${{ matrix.os }} + + # new memcached + dbg-new: + name: dbg-new () + runs-on: # env: - CMAKE_CONFIG_TYPE: Release - OS_VND: Linux - OS_VER: ${{ matrix.os }} - CC_VND: ${{ matrix.compiler_vendor }} - CC_VER: ${{ matrix.compiler_version }} + CMAKE_BUILD_TYPE: "Debug" + BUILD_TESTING: "ON" + VERBOSE: "ON" + CFLAGS: "-O0 --coverage" + CXXFLAGS: "-O0 --coverage" + INSTALL_MEMCACHED: "" + MEMCACHED_PREFIX: "/tmp" + ENABLE_SASL: "ON" steps: - uses: actions/checkout@v2 - + - uses: actions/checkout@v2 + with: + repository: memcached/memcached + path: memcached + ref: 1.6.7 + + - uses: codecov/codecov-action@v1.0.13 # sanitizer build - ci-san: + sanitizer: runs-on: # + strategy: + matrix: + sanitizer: ['address;undefined', 'thread'] env: - ENABLE_SANITIZERS: "address;undefined" - steps: + CMAKE_BUILD_TYPE: "Debug" + BUILD_TESTING: "ON" + VERBOSE: "ON" + ENABLE_SANITIZERS: ${{ matrix.sanitizer }} + steps: - uses: actions/checkout@v2 - + - # coverage build - ci-cov: - runs-on: # + # mac debug + dbg-mac: + name: dbg-mac (, , ) + runs-on: # env: - CFLAGS: --coverage - CXXFLAGS: --coverage - steps: + CMAKE_BUILD_TYPE: "Debug" + BUILD_TESTING: "ON" + VERBOSE: "ON" + CFLAGS: "-O0 --coverage" + CXXFLAGS: "-O0 --coverage" + + continue-on-error: true + steps: - uses: actions/checkout@v2 - + - uses: codecov/codecov-action@v1.0.13 - # memcached new - ci-new: - runs-on: # + # mac release + rel-mac: + name: rel-mac (, , ) + runs-on: # env: - INSTALL_MEMCACHED: - MEMCACHED_PREFIX: /tmp - MEMCACHED_BINARY: /tmp/bin/memcached - enable_sasl: yes - enable_sasl_pwdb: yes - enable_docs: no - enable_coverage: no - enable_dependency_tracking: no + CMAKE_BUILD_TYPE: "Release" + BUILD_DOCS_MANGZ: "ON" + + continue-on-error: true steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + + # windows release builds + windows: + strategy: + fail-fast: false + matrix: + os_ver: [] + cc_vnd: [msvc, mingw] + cc_ver: [cur] + runs-on: ${{ matrix.os_ver }} + continue-on-error: true + env: + CMAKE_BUILD_TYPE: "Release" + OS_VND: Windows + OS_VER: ${{ matrix.os_ver }} + CC_VND: ${{ matrix.cc_vnd }} + CC_VER: ${{ matrix.cc_ver }} + steps: - uses: actions/checkout@v2 with: - repository: memcached/memcached - ref: 1.6.7 - - name: Build memcached - run: | - cd memcached - ./autogen.sh - ./configure CFLAGS="-O2 -pipe" --prefix=${MEMCACHED_PREFIX} - make -j2 - make install - cd .. - + fetch-depth: 0 + + # linux release builds + release: + strategy: + fail-fast: false + matrix: + os_ver: [ubuntu-20.04, ubuntu-18.04] + cc_vnd: [gnu, clang] + cc_ver: [new, cur, old] + runs-on: ${{ matrix.os_ver }} + continue-on-error: ${{ matrix.cc_vnd == 'clang' }} + env: + CMAKE_BUILD_TYPE: "Release" + BUILD_DOCS_MANGZ: "ON" + OS_VND: Linux + OS_VER: ${{ matrix.os_ver }} + CC_VND: ${{ matrix.cc_vnd }} + CC_VER: ${{ matrix.cc_ver }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 +