|
| 1 | +name: test-linux |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + branches: [master] |
| 8 | + |
| 9 | +jobs: |
| 10 | + tests: |
| 11 | + name: Test Compile ${{ matrix.compiler }} |
| 12 | + runs-on: ubuntu-latest |
| 13 | + env: |
| 14 | + CC: ${{ matrix.compiler }} |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + compiler: [clang, gcc] |
| 19 | + |
| 20 | + steps: |
| 21 | + |
| 22 | + |
| 23 | + - name: Install Doxygen |
| 24 | + run: sudo apt-get install doxygen graphviz |
| 25 | + |
| 26 | + - name: Configure build |
| 27 | + run: cmake -Bbuild -DWARNINGS_AS_ERRORS=ON . |
| 28 | + |
| 29 | + - name: Formatting check |
| 30 | + working-directory: build |
| 31 | + run: | |
| 32 | + clang-format-9 --version |
| 33 | + make format |
| 34 | + git diff --exit-code |
| 35 | +
|
| 36 | + - name: Build |
| 37 | + working-directory: build |
| 38 | + run: make |
| 39 | + |
| 40 | + - name: binding-functions |
| 41 | + working-directory: build |
| 42 | + run: | |
| 43 | + make binding-functions |
| 44 | + test -s binding-functions |
| 45 | +
|
| 46 | + - name: Tests |
| 47 | + working-directory: build |
| 48 | + run: | |
| 49 | + make test |
| 50 | + sudo make install |
| 51 | +
|
| 52 | + # Note the packages aren't used to test the examples below |
| 53 | + - name: Test packaging |
| 54 | + working-directory: build |
| 55 | + run: cpack -D CPACK_PACKAGE_CONTACT="Test build in CI" |
| 56 | + |
| 57 | + - name: Examples |
| 58 | + run: | |
| 59 | + mkdir build/examples |
| 60 | + cd build/examples |
| 61 | + cmake ../../examples |
| 62 | + make |
| 63 | + make test |
| 64 | +
|
| 65 | + valgrind-tests: |
| 66 | + name: Test Valgrind |
| 67 | + runs-on: ubuntu-latest |
| 68 | + |
| 69 | + steps: |
| 70 | + |
| 71 | + |
| 72 | + - name: Install Valgrind |
| 73 | + run: sudo apt-get install valgrind |
| 74 | + |
| 75 | + - name: Configure build |
| 76 | + run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DWRAP_VALGRIND=ON . |
| 77 | + |
| 78 | + - name: Build |
| 79 | + working-directory: build |
| 80 | + run: make |
| 81 | + |
| 82 | + - name: Tests |
| 83 | + working-directory: build |
| 84 | + env: |
| 85 | + CTEST_OUTPUT_ON_FAILURE: 1 |
| 86 | + run: make test-fast |
| 87 | + |
| 88 | + coverage-tests: |
| 89 | + name: Coverage |
| 90 | + runs-on: ubuntu-latest |
| 91 | + env: |
| 92 | + CC: gcc |
| 93 | + |
| 94 | + steps: |
| 95 | + |
| 96 | + |
| 97 | + - name: Install lcov |
| 98 | + run: sudo apt-get install lcov |
| 99 | + |
| 100 | + - name: Configure build |
| 101 | + run: cmake -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_AS_ERRORS=ON -DH3_PREFIX=testprefix_ . |
| 102 | + |
| 103 | + - name: Build |
| 104 | + run: make |
| 105 | + |
| 106 | + - name: Tests |
| 107 | + run: make coverage |
| 108 | + |
| 109 | + - uses: coverallsapp/github-action@master |
| 110 | + with: |
| 111 | + path-to-lcov: ./coverage.cleaned.info |
| 112 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments