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 | |
Varun Sharma | bd1e5db | 2022-09-14 07:31:30 -0700 | [diff] [blame] | 12 | permissions: |
| 13 | contents: read |
| 14 | |
Jiayu Liu | c6f18a5 | 2022-05-22 04:01:43 +0800 | [diff] [blame] | 15 | jobs: |
| 16 | compiler: |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 17 | runs-on: ubuntu-22.04 |
Jiayu Liu | c6f18a5 | 2022-05-22 04:01:43 +0800 | [diff] [blame] | 18 | steps: |
dependabot[bot] | a14231c | 2023-10-04 18:33:29 -0400 | [diff] [blame] | 19 | - uses: actions/checkout@v4 |
Jiayu Liu | c6f18a5 | 2022-05-22 04:01:43 +0800 | [diff] [blame] | 20 | |
| 21 | - name: Install dependencies |
| 22 | run: | |
| 23 | sudo apt-get update -yq |
| 24 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 25 | |
| 26 | - name: Generate makefile using CMake |
| 27 | run: | |
| 28 | mkdir cmake_build |
| 29 | cd cmake_build |
| 30 | cmake .. -DBUILD_LIBRARIES=OFF |
| 31 | |
| 32 | - name: Run make |
| 33 | run: | |
| 34 | cd cmake_build |
| 35 | cmake --build . |
| 36 | |
| 37 | - name: Run test |
| 38 | run: | |
| 39 | cd cmake_build |
| 40 | ctest -j$(nproc) |