|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + |
| 9 | +env: |
| 10 | + # Enable parallel builds |
| 11 | + CMAKE_BUILD_PARALLEL_LEVEL: 4 |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-and-test-linux: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + build-type: [Debug, Release] |
| 20 | + #enable-coverage: [false, true] |
| 21 | + #exclude: |
| 22 | + # - build-type: Debug |
| 23 | + # enable-coverage: true |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout code |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Cache dependencies |
| 30 | + uses: actions/cache@v4 |
| 31 | + with: |
| 32 | + path: | |
| 33 | + ~/.cache/ccache |
| 34 | + ~/.local |
| 35 | + key: ${{ runner.os }}-deps-${{ hashFiles('**/CMakeLists.txt', '**/package.json', '**/requirements.txt') }} |
| 36 | + restore-keys: | |
| 37 | + ${{ runner.os }}-deps- |
| 38 | +
|
| 39 | + - name: Install system dependencies |
| 40 | + run: | |
| 41 | + sudo apt-get update |
| 42 | + sudo apt-get install -y \ |
| 43 | + build-essential \ |
| 44 | + cmake \ |
| 45 | + bison \ |
| 46 | + flex \ |
| 47 | + libgmp-dev \ |
| 48 | + libboost-program-options-dev \ |
| 49 | + libboost-iostreams-dev \ |
| 50 | + libboost-test-dev \ |
| 51 | + libboost-thread-dev \ |
| 52 | + libboost-system-dev \ |
| 53 | + libreadline-dev \ |
| 54 | + default-jre \ |
| 55 | + gperf \ |
| 56 | + python3-pip \ |
| 57 | + ccache |
| 58 | +
|
| 59 | + - name: Setup ccache |
| 60 | + run: | |
| 61 | + echo "CCACHE_DIR=$HOME/.cache/ccache" >> $GITHUB_ENV |
| 62 | + ccache --max-size=1G |
| 63 | +
|
| 64 | + - name: Install SMT solvers |
| 65 | + run: | |
| 66 | + bash contrib/install_yices2.sh |
| 67 | +
|
| 68 | + #- name: Install coverage tools |
| 69 | + # if: matrix.enable-coverage |
| 70 | + # run: | |
| 71 | + # pip3 install --user cpp-coveralls |
| 72 | + |
| 73 | + - name: Configure and build |
| 74 | + run: | |
| 75 | + mkdir -p build |
| 76 | + cd build |
| 77 | + #cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_COVERAGE=${{ matrix.enable-coverage }} .. |
| 78 | + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} .. |
| 79 | + make -j${{ env.CMAKE_BUILD_PARALLEL_LEVEL }} |
| 80 | +
|
| 81 | + # - name: Run tests |
| 82 | + # run: | |
| 83 | + # cd build |
| 84 | + # make check |
| 85 | + # timeout-minutes: 30 |
| 86 | + |
| 87 | + #- name: Upload coverage to Coveralls |
| 88 | + # if: matrix.enable-coverage |
| 89 | + # run: | |
| 90 | + # cd build |
| 91 | + # coveralls -r .. -b . --gcov-options '\-lp' |
| 92 | + # env: |
| 93 | + # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 94 | + |
| 95 | + - name: Show ccache statistics |
| 96 | + run: ccache -s |
| 97 | + |
| 98 | + build-macos: |
| 99 | + runs-on: macos-latest |
| 100 | + |
| 101 | + strategy: |
| 102 | + matrix: |
| 103 | + build-type: [Debug, Release] |
| 104 | + |
| 105 | + steps: |
| 106 | + - name: Checkout code |
| 107 | + uses: actions/checkout@v4 |
| 108 | + |
| 109 | + - name: Install dependencies via Homebrew |
| 110 | + run: | |
| 111 | + brew update |
| 112 | + brew install cmake boost gmp bison flex readline ccache autoconf automake libtool |
| 113 | +
|
| 114 | + - name: Install SMT solvers |
| 115 | + run: | |
| 116 | + bash contrib/install_yices2.sh |
| 117 | +
|
| 118 | + - name: Install Java |
| 119 | + run: | |
| 120 | + brew install --cask temurin |
| 121 | +
|
| 122 | + - name: Setup ccache |
| 123 | + run: | |
| 124 | + echo "CCACHE_DIR=$HOME/.cache/ccache" >> $GITHUB_ENV |
| 125 | + ccache --max-size=1G |
| 126 | +
|
| 127 | + - name: Configure and build |
| 128 | + run: | |
| 129 | + mkdir -p build |
| 130 | + cd build |
| 131 | + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_PREFIX_PATH=$BREW_PREFIX .. |
| 132 | + make -j$(sysctl -n hw.ncpu) |
| 133 | +
|
| 134 | + - name: Run tests |
| 135 | + run: | |
| 136 | + cd build |
| 137 | + make check |
| 138 | + timeout-minutes: 30 |
| 139 | + |
| 140 | + - name: Show ccache statistics |
| 141 | + run: ccache -s |
0 commit comments