|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + - run: ./scripts/clang-format-check |
| 15 | + |
| 16 | + autotools: |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + os: ["ubuntu-latest", "macos-latest"] |
| 20 | + cc: ["gcc", "clang"] |
| 21 | + |
| 22 | + runs-on: ${{matrix.os}} |
| 23 | + |
| 24 | + steps: |
| 25 | + - if: ${{runner.os == 'macOS'}} |
| 26 | + run: brew install autoconf automake libtool |
| 27 | + - uses: actions/checkout@v2 |
| 28 | + - run: autoreconf -fi |
| 29 | + - env: |
| 30 | + CC: ${{matrix.cc}} |
| 31 | + CFLAGS: -Werror |
| 32 | + run: ./configure |
| 33 | + - run: make check |
| 34 | + |
| 35 | + cmake: |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + os: ["ubuntu-latest", "macos-latest", "windows-latest"] |
| 39 | + cc: ["gcc", "clang"] |
| 40 | + exclude: |
| 41 | + - os: windows-latest |
| 42 | + cc: gcc |
| 43 | + - os: windows-latest |
| 44 | + cc: clang |
| 45 | + include: |
| 46 | + - os: windows-latest |
| 47 | + cc: 'msvc' # Doesn't really matter, MSVC is always used on Windows |
| 48 | + |
| 49 | + runs-on: ${{matrix.os}} |
| 50 | + |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v2 |
| 53 | + - env: |
| 54 | + CC: ${{matrix.cc}} |
| 55 | + run: cmake . |
| 56 | + - run: cmake --build . |
| 57 | + - run: ctest |
| 58 | + |
| 59 | + valgrind: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v2 |
| 63 | + - run: sudo apt update && sudo apt install valgrind |
| 64 | + - run: cmake -DJANSSON_TEST_WITH_VALGRIND=ON . |
| 65 | + - run: cmake --build . |
| 66 | + - run: ctest |
| 67 | + |
| 68 | + coveralls: |
| 69 | + runs-on: ubuntu-latest |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v2 |
| 72 | + - run: sudo apt update && sudo apt install curl lcov |
| 73 | + - run: cmake -DJANSSON_COVERAGE=ON -DJANSSON_COVERALLS=ON -DCMAKE_BUILD_TYPE=Debug |
| 74 | + - run: cmake --build . |
| 75 | + - run: cmake --build . --target coveralls |
| 76 | + |
| 77 | + fuzz: |
| 78 | + runs-on: ubuntu-latest |
| 79 | + steps: |
| 80 | + - uses: actions/checkout@v2 |
| 81 | + - run: | |
| 82 | + git clone https://github.com/google/oss-fuzz.git /tmp/ossfuzz |
| 83 | + if [ "$GITHUB_HEAD_REF" ]; then |
| 84 | + BRANCH=${GITHUB_HEAD_REF##*/} |
| 85 | + else |
| 86 | + BRANCH=${GITHUB_REF##*/} |
| 87 | + fi |
| 88 | + sed -i "s@https://github.com/akheron/jansson.git@-b $BRANCH https://github.com/${{github.repository}}.git@" /tmp/ossfuzz/projects/jansson/Dockerfile |
| 89 | + pushd /tmp/ossfuzz |
| 90 | + python infra/helper.py build_image --pull jansson |
| 91 | + python infra/helper.py build_fuzzers jansson |
| 92 | + popd |
0 commit comments