tests.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: tests
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. jobs:
  8. lint:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v2
  12. - run: ./scripts/clang-format-check
  13. autotools:
  14. strategy:
  15. matrix:
  16. os: ["ubuntu-latest", "macos-latest"]
  17. cc: ["gcc", "clang"]
  18. runs-on: ${{matrix.os}}
  19. steps:
  20. - if: ${{runner.os == 'macOS'}}
  21. run: brew install autoconf automake libtool
  22. - uses: actions/checkout@v2
  23. - run: autoreconf -fi
  24. - env:
  25. CC: ${{matrix.cc}}
  26. CFLAGS: -Werror
  27. run: ./configure
  28. - run: make check
  29. cmake:
  30. strategy:
  31. matrix:
  32. os: ["ubuntu-latest", "macos-latest", "windows-latest"]
  33. cc: ["gcc", "clang"]
  34. exclude:
  35. - os: windows-latest
  36. cc: gcc
  37. - os: windows-latest
  38. cc: clang
  39. include:
  40. - os: windows-latest
  41. cc: 'msvc' # Doesn't really matter, MSVC is always used on Windows
  42. runs-on: ${{matrix.os}}
  43. steps:
  44. - uses: actions/checkout@v2
  45. - env:
  46. CC: ${{matrix.cc}}
  47. run: cmake .
  48. - run: cmake --build .
  49. - run: ctest
  50. valgrind:
  51. runs-on: ubuntu-latest
  52. steps:
  53. - uses: actions/checkout@v2
  54. - run: sudo apt update && sudo apt install valgrind
  55. - run: cmake -DJANSSON_TEST_WITH_VALGRIND=ON .
  56. - run: cmake --build .
  57. - run: ctest
  58. coveralls:
  59. runs-on: ubuntu-latest
  60. steps:
  61. - uses: actions/checkout@v2
  62. - run: sudo apt update && sudo apt install curl lcov
  63. - run: cmake -DJANSSON_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug .
  64. - run: cmake --build .
  65. - run: cmake --build . --target coverage
  66. - name: Coveralls
  67. uses: coverallsapp/github-action@master
  68. with:
  69. github-token: ${{ secrets.GITHUB_TOKEN }}
  70. path-to-lcov: coverage.info