1name: 'Build with CMake'
2
3on:
4  push:
5    branches: [ '*' ]
6  pull_request:
7    branches: [ '*' ]
8
9env:
10  BUILD_DEPS: bison flex g++ libboost-all-dev libevent-dev libssl-dev make cmake
11
12permissions:
13  contents: read
14
15jobs:
16  compiler:
17    runs-on: ubuntu-20.04
18    steps:
19      - uses: actions/checkout@v3
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)
41