|
| 1 | +name: CMake Build Matrix |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +env: |
| 6 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 7 | + BUILD_TYPE: Release |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + # The CMake configure and build commands are platform agnostic and should work equally |
| 12 | + # well on Windows or Mac. You can convert this to a matrix build if you need |
| 13 | + # cross-platform coverage. |
| 14 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest, windows-latest] |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + |
| 23 | + - name: Install Dependencies (Linux) |
| 24 | + run: sudo apt-get install libboost-dev |
| 25 | + if: matrix.os == 'ubuntu-latest' |
| 26 | + |
| 27 | + - name: Create Build Environment |
| 28 | + # Some projects don't allow in-source building, so create a separate build directory |
| 29 | + # We'll use this as our working directory for all subsequent commands |
| 30 | + run: cmake -E make_directory ${{github.workspace}}/build |
| 31 | + |
| 32 | + - name: Configure CMake |
| 33 | + # Use a bash shell so we can use the same syntax for environment variable |
| 34 | + # access regardless of the host operating system |
| 35 | + shell: bash |
| 36 | + working-directory: ${{github.workspace}}/build |
| 37 | + # Note the current convention is to use the -S and -B options here to specify source |
| 38 | + # and build directories, but this is only available with CMake 3.13 and higher. |
| 39 | + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
| 40 | + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON |
| 41 | + |
| 42 | + - name: Build |
| 43 | + working-directory: ${{github.workspace}}/build |
| 44 | + shell: bash |
| 45 | + # Execute the build. You can specify a specific target with "--target <NAME>" |
| 46 | + run: cmake --build . --config $BUILD_TYPE |
| 47 | + |
| 48 | + - name: run test (Linux) |
| 49 | + if: matrix.os == 'ubuntu-latest' |
| 50 | + working-directory: ${{github.workspace}}/build |
| 51 | + run: ./bin/behaviortree_cpp_v3_test |
| 52 | + |
0 commit comments