Jiayu Liu | c6f18a5 | 2022-05-22 04:01:43 +0800 | [diff] [blame^] | 1 | name: 'Build with CMake' |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [ '*' ] |
| 6 | pull_request: |
| 7 | branches: [ '*' ] |
| 8 | |
| 9 | env: |
| 10 | BUILD_DEPS: bison flex g++ libboost-all-dev libevent-dev libssl-dev make cmake |
| 11 | |
| 12 | jobs: |
| 13 | compiler: |
| 14 | runs-on: ubuntu-20.04 |
| 15 | steps: |
| 16 | - uses: actions/checkout@v3 |
| 17 | |
| 18 | - name: Install dependencies |
| 19 | run: | |
| 20 | sudo apt-get update -yq |
| 21 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 22 | |
| 23 | - name: Generate makefile using CMake |
| 24 | run: | |
| 25 | mkdir cmake_build |
| 26 | cd cmake_build |
| 27 | cmake .. -DBUILD_LIBRARIES=OFF |
| 28 | |
| 29 | - name: Run make |
| 30 | run: | |
| 31 | cd cmake_build |
| 32 | cmake --build . |
| 33 | |
| 34 | - name: Run test |
| 35 | run: | |
| 36 | cd cmake_build |
| 37 | ctest -j$(nproc) |