Skip to content

Commit

Permalink
Merge pull request #434 from jupp0r/separate-cmake-ci-retry
Browse files Browse the repository at this point in the history
ci: Make CMake workflow more fine-grained
  • Loading branch information
gjasny committed Dec 24, 2020
2 parents 75bfdb1 + caaf890 commit 17ef02a
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 75 deletions.
31 changes: 0 additions & 31 deletions .github/scripts/run-cmake-test

This file was deleted.

17 changes: 0 additions & 17 deletions .github/scripts/run-cmake-test.cmd

This file was deleted.

4 changes: 0 additions & 4 deletions .github/scripts/run-prepare.cmd

This file was deleted.

109 changes: 109 additions & 0 deletions .github/workflows/cmake-ci.yml
@@ -0,0 +1,109 @@
name: CMake CI
on: [push, pull_request]

jobs:
build:
name: CMake on ${{ matrix.os }} with ${{ matrix.dependencies }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-18.04, windows-2016]
dependencies: [submodule, vcpkg]
steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Checkout submodules
if: matrix.dependencies == 'submodule'
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Mount vcpkg cache
if: matrix.dependencies == 'vcpkg'
uses: actions/cache@v2
with:
path: "~/.cache/vcpkg/archives"
key: vcpkg-${{ runner.os }}

- name: install vcpkg dependencies
if: matrix.dependencies == 'vcpkg'
run: vcpkg install benchmark civetweb curl[core] gtest zlib

- name: Generate German locale on Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
sudo apt-get update
sudo apt-get install -y locales
sudo locale-gen de_DE.UTF-8 # used by SerializerTest
- name: install ninja on Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get install -y ninja-build
- name: install ninja on macOS
if: runner.os == 'macOS'
run: brew install ninja

- name: "Configure for Unix with internal dependencies"
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
run: cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }} -B ${{ github.workspace }}/_build

- name: "Configure for Windows with internal dependencies"
if: matrix.dependencies == 'submodule' && runner.os == 'Windows'
run: cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -S ${{ github.workspace }} -B ${{ github.workspace }}/_build

- name: "Configure for Unix with vcpkg dependencies"
if: matrix.dependencies == 'vcpkg' && runner.os != 'Windows'
run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }} -B ${{ github.workspace }}/_build

- name: "Configure for Windows with vcpkg dependencies"
if: matrix.dependencies == 'vcpkg' && runner.os == 'Windows'
run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install "-DCMAKE_TOOLCHAIN_FILE=${Env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake" -DCMAKE_DEBUG_POSTFIX=_d -S ${{ github.workspace }} -B ${{ github.workspace }}/_build

- name: "Build Debug"
run: cmake --build ${{ github.workspace }}/_build --config Debug

- name: "Build Release"
run: cmake --build ${{ github.workspace }}/_build --config Release

- name: "Test Debug"
run: ctest -C Debug -V -LE Benchmark
working-directory: "${{ github.workspace }}/_build"

- name: "Test Release"
run: ctest -C Debug -V -LE Benchmark
working-directory: "${{ github.workspace }}/_build"

- name: "Install Debug"
run: cmake --install ${{ github.workspace }}/_build --config Debug

- name: "Install Release"
run: cmake --install ${{ github.workspace }}/_build --config Release

- name: "Configure import for Unix with internal dependencies"
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }}/cmake/project-import -B ${{ github.workspace }}/_import

- name: "Configure import for Windows with internal dependencies"
if: matrix.dependencies == 'submodule' && runner.os == 'Windows'
run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp -S ${{ github.workspace }}/cmake/project-import -B ${{ github.workspace }}/_import

- name: "Configure import for Unix with vcpkg dependencies"
if: matrix.dependencies == 'vcpkg' && runner.os != 'Windows'
run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }}/cmake/project-import -B ${{ github.workspace }}/_import

- name: "Configure import for Windows with vcpkg dependencies"
if: matrix.dependencies == 'vcpkg' && runner.os == 'Windows'
run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp "-DCMAKE_TOOLCHAIN_FILE=${Env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake" -S ${{ github.workspace }}/cmake/project-import -B ${{ github.workspace }}/_import

- name: "Build import Debug"
run: cmake --build ${{ github.workspace }}/_import --config Debug

- name: "Build import Release"
run: cmake --build ${{ github.workspace }}/_import --config Release
23 changes: 0 additions & 23 deletions .github/workflows/continuous-integration-workflow.yml

This file was deleted.

0 comments on commit 17ef02a

Please sign in to comment.