|
| 1 | +# Copyright Agustin K-ballo Berge, Fusion Fenix 2020 |
| 2 | +# |
| 3 | +# Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 4 | +# file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | + |
| 6 | +name: CMake |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: |
| 11 | + paths: |
| 12 | + - 'CMakeLists.txt' |
| 13 | + - 'example/**' |
| 14 | + - '.github/workflows/cmake-ci.yml' |
| 15 | + pull_request: |
| 16 | + |
| 17 | +defaults: |
| 18 | + run: |
| 19 | + shell: bash |
| 20 | + |
| 21 | +jobs: |
| 22 | + find_package: |
| 23 | + name: find_package - ${{ matrix.os }} |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 29 | + |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v1 |
| 32 | + |
| 33 | + - name: Configure library |
| 34 | + run: | |
| 35 | + mkdir build |
| 36 | + cd build |
| 37 | + cmake -DCMAKE_CXX_STANDARD=11 \ |
| 38 | + -DCMAKE_INSTALL_PREFIX=${PWD}/install \ |
| 39 | + .. |
| 40 | +
|
| 41 | + - name: Install library |
| 42 | + working-directory: build |
| 43 | + run: | |
| 44 | + cmake --install . |
| 45 | +
|
| 46 | + - name: Configure example |
| 47 | + working-directory: example |
| 48 | + run: | |
| 49 | + mkdir build |
| 50 | + cd build |
| 51 | + cmake -DCMAKE_CXX_STANDARD=11 \ |
| 52 | + -DEggs.Invoke_DIR=${PWD}/../../build/install/lib/cmake/eggs.invoke \ |
| 53 | + .. |
| 54 | +
|
| 55 | + - name: Build example |
| 56 | + working-directory: example/build |
| 57 | + run: | |
| 58 | + cmake --build . |
| 59 | +
|
| 60 | + add_subdirectory: |
| 61 | + name: add_subdirectory - ${{ matrix.os }} |
| 62 | + runs-on: ${{ matrix.os }} |
| 63 | + strategy: |
| 64 | + fail-fast: false |
| 65 | + matrix: |
| 66 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 67 | + |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v1 |
| 70 | + |
| 71 | + - name: Configure example |
| 72 | + working-directory: example |
| 73 | + run: | |
| 74 | + mkdir build |
| 75 | + cd build |
| 76 | + cmake -DCMAKE_CXX_STANDARD=11 \ |
| 77 | + -DEggs.Invoke_SOURCE_DIR=${PWD}/../.. \ |
| 78 | + .. |
| 79 | +
|
| 80 | + - name: Build example |
| 81 | + working-directory: example/build |
| 82 | + run: | |
| 83 | + cmake --build . |
| 84 | +
|
| 85 | + fetch_content: |
| 86 | + name: fetch_content - ${{ matrix.os }} |
| 87 | + runs-on: ${{ matrix.os }} |
| 88 | + strategy: |
| 89 | + fail-fast: false |
| 90 | + matrix: |
| 91 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 92 | + |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v1 |
| 95 | + |
| 96 | + - name: Configure example |
| 97 | + working-directory: example |
| 98 | + run: | |
| 99 | + mkdir build |
| 100 | + cd build |
| 101 | + cmake -DCMAKE_CXX_STANDARD=11 \ |
| 102 | + .. |
| 103 | +
|
| 104 | + - name: Build example |
| 105 | + working-directory: example/build |
| 106 | + run: | |
| 107 | + cmake --build . |
0 commit comments